Skip to content

Commit

Permalink
Merge pull request #96 from risinek/nested_objects_search
Browse files Browse the repository at this point in the history
resolves #86 update README to describe nested primitives
  • Loading branch information
deitch authored Aug 11, 2023
2 parents 8623e6d + dd06908 commit 0b7f56e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ Thus, the search primitive `{"name.cars.hp":{from:200}}` will match any of the f
* `{cars: {brand: 'porsche',hp:450}}`
* `{cars: [{brand: 'bmw',hp:250},{brand: 'lada',hp:10}]}` matches the 'bmw' but not the 'lada', therefore the whole object matches

You can also deep-search for an object using nested primitives. Search primitive `{cars: {brand: 'porsche',hp:450}}` will match:
* `{name: 'alice', cars:[{brand: 'porsche',hp:450}, {brand: 'bmw',hp:250}, {brand: 'lada',hp:10}]}`

But will not match following:
* `{name: 'alice', cars:[{brand: 'porsche',hp:250}, {brand: 'bmw',hp:450}, {brand: 'lada',hp:10}]}`

Number of levels of deep-searching is not limited. The valid primitive may look like `{cars: {brand: 'porsche',hp:450, color: {exterior: 'red', interior: {seats: 'beige', dashboard: 'black'}}}}`


#### Property Search

Expand Down

0 comments on commit 0b7f56e

Please sign in to comment.