I want to find and project. In the mongo shell, I might write this:
db.spines.find({'group_id': {$gt: 285}}, {'group_id': 1, 'wrapper_version': 1})
In C++ (driver source as 3.1.3 / 002fbaf5), I naively try this,
which, of course, doesn't work:
mongocxx::cursor cursor = spines.find(
document{} << "group_id" << open_document << "$gt" << 285
<< close_document << open_document << "group_id" << true
<< "wrapper_version" << true << close_document << finalize);
for (auto doc : cursor) {
cout << bsoncxx::to_json(doc) << endl;
}
Any pointers?
Related, I've not found proper documentation on the C++ driver, only the tutorial (which is great for getting started) and the code (which is commented, but doesn't help me get unlost, just explains what each individual function does). Does it exist yet? I ask not to nag (I prefer code to documentation, in the end, and the code is really great once I understand it) but because I'd like to help myself as much as possible. Perhaps I've missed something.
Thanks!
-- Jeff Abrahamson +33 6 24 40 01 57 +44 7920 594 255 http://p27.eu/jeff/
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/8a21d7da-f34a-e998-92c7-00242170cab2%40p27.eu.
For more options, visit https://groups.google.com/d/optout.
I want to find and project. In the mongo shell, I might write this:
db.spines.find({'group_id': {$gt: 285}}, {'group_id': 1, 'wrapper_version': 1})
In C++ (driver source as 3.1.3 / 002fbaf5), I naively try this, which, of course, doesn't work:
mongocxx::cursor cursor = spines.find(
document{} << "group_id" << open_document << "$gt" << 285
<< close_document << open_document << "group_id" << true
<< "wrapper_version" << true << close_document << finalize);
for (auto doc : cursor) {
cout << bsoncxx::to_json(doc) << endl;
}
Any pointers?
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/f1ab8dd6-0ad9-d131-feb1-b2a25b37e24b%40p27.eu.
https://github.com/mongodb/mongo-cxx-driver/blob/master/examples/bsoncxx/builder_basic.cpp
https://mongodb.github.io/mongo-cxx-driver/mongocxx-v3/working-with-bson/#builders
https://stackoverflow.com/questions/43770113/mongocxx-array-of-objectid-in-find
https://stackoverflow.com/questions/42952742/how-to-generate-mongodb-documents-recursively-using-mongocxx-c-driver/42987087#42987087
https://stackoverflow.com/questions/42445029/ambiguous-operator-in-mongodb-c-driver-document-builder/42463387#42463387
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/c218d628-4e7c-31e2-3a08-b68bb3f26ec8%40p27.eu.
You received this message because you are subscribed to a topic in the Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mongodb-user/mPDJXBKFn80/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mongodb-user+unsubscribe@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/CAHX05qFF0FBYigaRRJJ5%3DejirwLQcSdWeFVHE2zK8LiVDibz_A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/CAM4Y7zwuD8EiS52rWDUwOfOpPZhf7XL_rFwoz2onbkCSFbPLxg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/CAHX05qHF-%3DMA6o4TeyFuEt%2B6-WFdp82G381iyrBs0cDeywM0bg%40mail.gmail.com.