Foundatio.Repositories icon indicating copy to clipboard operation
Foundatio.Repositories copied to clipboard

Adds nested field tests

Open niemyjski opened this issue 6 months ago • 1 comments

Introduces improved nested field support and related tests.

This commit addresses the need for testing nested fields. It includes a new test file, updates configurations, and adds utilities for generating test data with nested properties. A nested field is also added to the default search fields.

niemyjski avatar Jul 18 '25 16:07 niemyjski

@niemyjski Issue is, exists dont work on Nested array type, Here is step by step scenario, where exists not working.

  1. Model to have List/set public ISet<Tracking> Trackings { get; set; } = new HashSet<Tracking>();

  2. This prop should be Nested type in Index

        return map
            .Dynamic(false)
            .Properties(p => p
                .SetupDefaults()
                .Keyword(f => f.Name(o => o.Id))
                .Nested<Tracking>(f => f
                        .Dynamic(false)
                        .Name(i => i.Trackings )
                        .Properties(mdp => mdp
                            .Keyword(k => k.Name(i => i.Id))
                            .Keyword(k => k.Name(i => i.OriginTags))
                        )
                )
  1. Now exists wonts work
_exists_:trackings
_exists_:trackings.id

scharde-encora avatar Dec 05 '25 14:12 scharde-encora