python - Pymongo return data without _id -


as title says, how can find() in mongo data without _id index in list.

of course can drop later like:

for in data:    del i['_id'] 

but there more elegant solution without needing loop?

if understand question correctly, think you're looking projections:

http://docs.mongodb.org/manual/reference/method/db.collection.find/#projections

something should it:

db.test.find(query,{"_id":0}) 

Comments