diff options
author | Eliot Horowitz <eliot@10gen.com> | 2014-08-25 17:25:39 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2014-08-25 18:08:37 -0400 |
commit | f0bb5123f50bb617eb9499539f01779c6e9f5e95 (patch) | |
tree | 98cc4abf3c89881691158345435523c5dd6ae37f /src/mongo/db/commands/geo_near_cmd.cpp | |
parent | cb3f5cfa43d9565675d2f36c4b0f7cecbad47a49 (diff) | |
download | mongo-f0bb5123f50bb617eb9499539f01779c6e9f5e95.tar.gz |
SERVER-13635: OperationContext on read paths
Diffstat (limited to 'src/mongo/db/commands/geo_near_cmd.cpp')
-rw-r--r-- | src/mongo/db/commands/geo_near_cmd.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/db/commands/geo_near_cmd.cpp b/src/mongo/db/commands/geo_near_cmd.cpp index 187fdf1caad..7b1be4adc82 100644 --- a/src/mongo/db/commands/geo_near_cmd.cpp +++ b/src/mongo/db/commands/geo_near_cmd.cpp @@ -97,7 +97,7 @@ namespace mongo { // We seek to populate this. string nearFieldName; bool using2DIndex = false; - if (!getFieldName(collection, indexCatalog, &nearFieldName, &errmsg, &using2DIndex)) { + if (!getFieldName(txn, collection, indexCatalog, &nearFieldName, &errmsg, &using2DIndex)) { return false; } @@ -261,12 +261,12 @@ namespace mongo { } private: - bool getFieldName(Collection* collection, IndexCatalog* indexCatalog, string* fieldOut, - string* errOut, bool *isFrom2D) { + bool getFieldName(OperationContext* txn, Collection* collection, IndexCatalog* indexCatalog, + string* fieldOut, string* errOut, bool *isFrom2D) { vector<IndexDescriptor*> idxs; // First, try 2d. - collection->getIndexCatalog()->findIndexByType(IndexNames::GEO_2D, idxs); + collection->getIndexCatalog()->findIndexByType(txn, IndexNames::GEO_2D, idxs); if (idxs.size() > 1) { *errOut = "more than one 2d index, not sure which to run geoNear on"; return false; @@ -287,7 +287,7 @@ namespace mongo { // Next, 2dsphere. idxs.clear(); - collection->getIndexCatalog()->findIndexByType(IndexNames::GEO_2DSPHERE, idxs); + collection->getIndexCatalog()->findIndexByType(txn, IndexNames::GEO_2DSPHERE, idxs); if (0 == idxs.size()) { *errOut = "no geo indices for geoNear"; return false; |