Query in MongoDb for fetching record

user1774890

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

TeTeT

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Mysql query fetching record between two months

From Dev

Fetching last record from mongodb using node.js

From Dev

MongoDB $pull query not remove and update the existing record

From Dev

Mongodb Query: Latest record by date for each item

From Dev

callback not fetching record in nodejs

From Dev

mongodb fetching array values

From Java

Iterator hasNext for the last record fetching

From Dev

xslt Distinct record fetching product

From Dev

Mysqli query fetching no records

From Dev

Postgresql query for fetching records

From Dev

Issue with fetching query

From Dev

MongoDB mapReduce() query to aggregate data into a list inside a record

From Dev

Mongodb-PHP: What is the query for retriving record of messages with status unread

From Dev

MongoDB project updated record in a nested array in "findAndModify" query

From Dev

How to query and show a field in an array for each mongodb record?

From Dev

join query not fetching any data

From Dev

Fetching two matches in a MySQL query?

From Dev

SQL Query fetching wrong rows

From Dev

Grouping the data after fetching the query

From Dev

Nested query not fetching data correctly

From Dev

Fetching wrong data in query in rails

From Dev

SQL Query fetching wrong rows

From Dev

sql query for fetching correct year

From Dev

Fetching two matches in a MySQL query?

From Dev

Sql query is not fetching results with variables

From Dev

Fetching the Odata query parameter in code

From Dev

Get belongsTo ID without fetching record

From Dev

Mysql stored procedure issue in fetching record

From Dev

fetching only latest data in mysql for each record