Mongodb- how to unwind a object not an array -
i have collection this, need unwind "myuser" object.
{"_id" : objectid("578508630420bec15ea9876c"), "current" : "selectcategory", "myuser" : { "_id" : "56c49c540d9e391243ce2752", "myoptions" : [ { "id" : "jobs", "name" : "emploi" } ], "mychannel" : "ussd", "mycreatedate" : "2016-02-17t16:14:12.899z", "myemail" : "", "mygender" : "", "myhidemsisdn" : "no", "mylang" : "fr", "mylastupdate" : "2016-02-26t11:32:29.786z", "myyob" : -1 }, "userinput" : "continue", "ussdsession" : "303819320" }
i'm looking output myuser :
["_id","myoptions","mychannel","mycreatedate","myemail","mygender","myhidemsisdn","mylang","mylastupdate","myyob"]
i can keys of collection.but myuser nested object has keys.thanks in advance
Comments
Post a Comment