Możesz użyć mongocxx::collection ::znajdź
. Powinny działać:
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);