summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/document.cpp
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2013-07-25 14:33:25 -0400
committerMathias Stearn <mathias@10gen.com>2013-07-25 14:45:05 -0400
commitdf0b4c10f397e281ae6350ed35310fd994ff0539 (patch)
tree6f6bb271945151932d3164215a9502f0ed93864f /src/mongo/db/pipeline/document.cpp
parentf69cfc007eed38592c879ebf9345ec70f9587aa0 (diff)
downloadmongo-df0b4c10f397e281ae6350ed35310fd994ff0539.tar.gz
Add returning version of Document::toBson()
Diffstat (limited to 'src/mongo/db/pipeline/document.cpp')
-rw-r--r--src/mongo/db/pipeline/document.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/pipeline/document.cpp b/src/mongo/db/pipeline/document.cpp
index c4273dfd461..432c2437439 100644
--- a/src/mongo/db/pipeline/document.cpp
+++ b/src/mongo/db/pipeline/document.cpp
@@ -225,6 +225,13 @@ namespace mongo {
}
}
+ BSONObj Document::toBson() const {
+ BSONObjBuilder bb;
+ toBson(&bb);
+ return bb.obj();
+ }
+
+
MutableDocument::MutableDocument(size_t expectedFields)
: _storageHolder(NULL)
, _storage(_storageHolder)