I need to retrieve a set of documents, with ALL underscore prefixed fields omitted and all other fields included. Of course this should be done in the query rather than document manipulation after retrieval.
All the operators like $regex, $in, $all seem to apply to values. I need to build a projection that ignores an unknown set of fields based on a pattern in the name. Something like:
db.coll.find({}, {"_*": 0})
Of course that doesn't work, but explains the idea.
I can't use positive projection, as I also am not aware of what fields exist in the document. The schema is dynamic as my end users can edit these documents with user-defined data.
Hope it's easy...
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb