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

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -