mongocxx::options::find::limit
。 mongocxx::collection::find
。以下が機能するはずです:
mongocxx::options::find opts;
opts.limit(10);
mongocxx::cursor cursor = coll.find(document{} << "loc" << open_document
<< "$near" << bsoncxx::builder::stream::open_array
<< lon << lat << bsoncxx::builder::stream::close_array
<< close_document << finalize, opts);