Saturday, 15 June 2013

mongodb - Search in parent or any of childs -



mongodb - Search in parent or any of childs -

i have collection of objects have childs unknown depth of nesting:

{ name: "foo", childs: [ { name: "bar", childs[]}, { name: "so", childs[ { name: "linq2vodka"}, { name: "kremlinwinterbearbalalaika"} ] } ] }

is there way find documents of kid (or main object itself) has "name" equal value? if not mutual way it? give thanks you!

update workaround can store parent , kid objects flattenned (i.e. array) along "chain" of id's holds nested structure. not sure if there's improve way.

mongodb mongodb-query

No comments:

Post a Comment