1
document = {
    "name" : "Lavish Inc."
    "address" : { 
    "street": "921 Street A"
    "zipcode" : "10005"
    "coord" : [-70.12831237, 40.3712642]
    }
}

Considering such a document structure how do I find() for coordinates < -60.

I tried something like this :

 cursor = collection.find({"address.coord[0]" : {"$lt" : -60}})

and also,

cursor = collection.find({"address.coord"[0] : {"$lt" : -60}})

No error comes because nothing is matched I guess.Something seems to be wrong. I'm not indexing the nested list correctly. How do I access index 0 of the list coordinates ? Any ideas ?

samuelv
  • 7
  • 2

0 Answers0