MongoDB
 SQL >> Base de Dados >  >> NoSQL >> MongoDB

Como usar índice geoespacial MongoDB em C++

Você pode usar mongocxx::options::find::limit e mongocxx::collection::find. Exemplo:

mongocxx::options::find opts; opts.limit(10); mongocxx::cursor cursor = coll.find(document{} << "loc" << open_document << "$near" << open_array << lon << lat << close_array << close_document << finalize, opts);