I am using mongoDb for saving my object.
This is my payloadObject :
{
"_id" : ObjectId("53763e6fe4b00e612650c18c"),
"_class" : "mkcl.os.transformer.PayloadObject",
"formId" : NumberLong(22),
"dataMap" : {
"gpsLocation" : "Latitude: 18.6099243, Longitude:73.7710601,Altitude:0.0",
"85" : "Prahlad Singh",
"86" : "25",
"88" : "16/05/14",
"92" : "",
"89" : "Male",
"91" : "Single",
"87" : "Pune",
"90" : "Employement"
},
"imageUrls" : { }
}
There are such 100 records, Now I wants to fetch records having key 90 . So that I get value of fields 90 (Like Employment in this case)
Thanks in Advance
You can use the $exists clause:
db.<coll>.find({"dataMap.90": {$exists: true}}, {"dataMap.90": 1})
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments