How can I do a select for all documents that have a parent.id that is equal to 3? I try doing this.parents.id == 3, but it doesn’t seem to be working…
[parents] => Array (
[0] => Array (
[id] => 1
[title] => Folder 1
)
[1] => Array (
[id] => 3
[title] => Folder 2
)
)
OK, so the PHP input is actually unclear. The PHP you provided could be one of the following JSON objects:
Version 1:
Version 2:
If you do
find({'parents.id':3})on version 1, this will work.If you do
find({'parents.id':3})on version 2, this will not work.The difference is not clear in PHP, so use the command-line and double-check.