K.hamdan
K.hamdan

Reputation: 103

getting value in mongoDB by key

how can i get the value of android for example from the following collection named "appVersions"

_id:5e2973985874e60017da3905
android:9
ios:1
foodTable:1
__v:0

Upvotes: 0

Views: 57

Answers (2)

Dado
Dado

Reputation: 1187

db.collection.find( {"_id": ObjectId("5e2973985874e60017da3905")} )

Upvotes: 2

Jairus Patrick Vallon
Jairus Patrick Vallon

Reputation: 366

You could use db.appVersions.findOne("5e2973985874e60017da3905"). That will return a document containing an android property.

Upvotes: 1

Related Questions