diff options
Diffstat (limited to 'src/mongo/bson/mutable/document.cpp')
-rw-r--r-- | src/mongo/bson/mutable/document.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/bson/mutable/document.cpp b/src/mongo/bson/mutable/document.cpp index d042e2a458f..3e7853146a1 100644 --- a/src/mongo/bson/mutable/document.cpp +++ b/src/mongo/bson/mutable/document.cpp @@ -1697,6 +1697,14 @@ void Element::writeTo(BSONObjBuilder* const builder) const { } } +void Element::writeChildrenTo(BSONObjBuilder* const builder) const { + invariant(ok()); + const Document::Impl& impl = getDocument().getImpl(); + const ElementRep& thisRep = impl.getElementRep(_repIdx); + invariant(impl.getType(thisRep) == mongo::Object); + impl.writeChildren(_repIdx, builder); +} + void Element::writeArrayTo(BSONArrayBuilder* const builder) const { invariant(ok()); const Document::Impl& impl = getDocument().getImpl(); |