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

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -