Here is a record from my mongoDB. I am trying to query it and using Pymongo.
{
"_id" : ObjectId("5925665bcb98a11aa4ca23f8"),
"EMAIL" : "jaffer@example.com",
"LOGIN" : [
"example"
],
"NAME" : [
"example name"
],
"URL" : [
"http://example.com"
]
}
I am trying to access the documents where the Key NAME
is available.
I tried to query something like this:
db.ff.find({"NAME":[]})
db.ff.find({"NAME":[1]})
I do not get any output.
When I made the specific query the result appeared.
db.ff.find({"NAME":["example name"]})
But I do not know how many records has NAME
as array key. Kindly, let me know how to find the record that have the Array Key as NAME
.