Queries the collection for existing documents, limiting what fields are returned by the database. (called projection)
import vibe.db.mongo.mongo; void test() { auto coll = connectMongoDB("127.0.0.1").getCollection("test"); // find documents with status == "A", return list of {"item":..., "status":...} coll.find(["status": "A"], ["item": 1, "status": 1]); }
- Querying: http://www.mongodb.org/display/DOCS/Querying - Projection: https://www.mongodb.com/docs/manual/tutorial/project-fields-from-query-results/#std-label-projections - findOne
See Implementation
Queries the collection for existing documents, limiting what fields are returned by the database. (called projection)