0

Given the schema:

{
  _id: ObjectID,
  city: 
   { units: 
      { abc: {},
        def: { tuid : String },
        ...
        xxx: { tuid : String }
   }
}

I would like to return, for a particular _id, all the properties of units who's subproperty tuid is, for example, 123.

I have searched for information about this but array operations keep popping up instead of what I need.

Thank you.

Discipol
  • 3,137
  • 4
  • 22
  • 41
  • 1
    You can't do it in a general way, you need to explicitly include each tuid path using dot notation. – JohnnyHK Nov 07 '13 at 23:24
  • Then I would need to group them by tuid when adding them but this would cause problems for other operations. Would some sort of aggregation help? @JohnnyHK – Discipol Nov 08 '13 at 08:16

0 Answers0