php - MongoDB get the id of a subdocument with ought loading the document -


an attribute in collection references collection's document looks this

collection {     "reffeddoc": {          "$ref": "myclass",          "$id": objectid("4e171cade3a9f23359e98206")        },     .... } 

so, how select reffeddoc.$id in fields? can fetch withought fetching entire subdocument? i've tried reffeddoc.$id

db.collection.find({}, {"reffeddoc.$id"}); 

and following error

positional operator not match query specifier 


Comments

Popular posts from this blog

How to logout from a login page in asp.net -

Stack level too deep error after upgrade to rails 3.2 and ruby 1.9.3 -