diff options
author | matt dannenberg <matt.dannenberg@10gen.com> | 2013-08-12 16:53:05 -0400 |
---|---|---|
committer | matt dannenberg <matt.dannenberg@10gen.com> | 2013-08-28 15:52:46 -0400 |
commit | 47272101ae458bfa0c01809bf5309a4c08c8e9c6 (patch) | |
tree | b11250cad8313ad3ca3b5a47bcefdf64dd05092c /src/mongo/db/pipeline/pipeline_d.cpp | |
parent | 40132af8cf5b0b9ab79f24dbce72d4d5b6af88f2 (diff) | |
download | mongo-47272101ae458bfa0c01809bf5309a4c08c8e9c6.tar.gz |
serialize to replace toBson in document sources and pipeline
Diffstat (limited to 'src/mongo/db/pipeline/pipeline_d.cpp')
-rw-r--r-- | src/mongo/db/pipeline/pipeline_d.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/mongo/db/pipeline/pipeline_d.cpp b/src/mongo/db/pipeline/pipeline_d.cpp index 8a8c2f88ba9..e6119fb01ec 100644 --- a/src/mongo/db/pipeline/pipeline_d.cpp +++ b/src/mongo/db/pipeline/pipeline_d.cpp @@ -119,24 +119,21 @@ namespace { index scan. */ intrusive_ptr<DocumentSourceSort> pSort; - BSONObjBuilder sortBuilder; + BSONObj sortObj; if (!sources.empty()) { const intrusive_ptr<DocumentSource> &pSC = sources.front(); pSort = dynamic_cast<DocumentSourceSort *>(pSC.get()); if (pSort) { - /* build the sort key */ - pSort->sortKeyToBson(&sortBuilder, false); + // build the sort key + sortObj = pSort->serializeSortKey().toBson(); } } - /* Create the sort object; see comments on the query object above */ - BSONObj sortObj = sortBuilder.obj(); - - /* get the full "namespace" name */ + // get the full "namespace" name string fullName(dbName + "." + pPipeline->getCollectionName()); - /* for debugging purposes, show what the query and sort are */ + // for debugging purposes, show what the query and sort are DEV { (log() << "\n---- query BSON\n" << queryObj.jsonString(Strict, 1) << "\n----\n"); |