I’ve collected tweet via the Streaming API and would like to make queries from the mongodb.
I’m new to MongoDB, so would this be the correct syntax to query for tweets with either coordinates or location information:
cursor = coll.find({"coordinates.type" : "Point"},{"coordinates" :1} or {"location": not "null" }, tailable = True, timeout = False)
I’m using pymongo and this is a capped collection.
Thanks
Take a look at both the $or and $ne operators.
From the official MongoDB docs:
$or: http://docs.mongodb.org/manual/reference/operator/or/
$ne: http://docs.mongodb.org/manual/reference/operator/ne/
You need to rewrite your query as following: