As the title says, how can I find() in my mongo all the data but without the _id index in the list.
Of course I can drop it later like:
for i in data:
del i['_id']
But is there a more elegant solution without needing that loop?
If I understand your question correctly, I think you're looking for projections:
http://docs.mongodb.org/manual/reference/method/db.collection.find/#projections
Something like this should do it:
db.test.find(query,{"_id":0})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With