node.js - Is it possible to retrieve a deep nested object using nested $elemMatch -


{    key: val,   groups: [{    key: val,    components [{      key: val    }]:    }] } 

basically data set similar above structure, want specific component object matches query. , possible retrieve component object using $elemmatch ( current code mentioned below )

findone({   _id: objectid(data._id),   groups: {      $elemmatch: {       _id: data.groupid,      competency: {        $elemmatch: { c_id: data.c_id}      }     }   }, }, { 'groups.$.competency.$$': 1 }) 


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -