summaryrefslogtreecommitdiff
path: root/src/mongo/bson/mutable/element.h
diff options
context:
space:
mode:
authorAndrew Morrow <acm@10gen.com>2013-04-05 16:59:30 -0400
committerAndrew Morrow <acm@10gen.com>2013-04-08 14:51:11 -0400
commitf6b0d41bc6f230822e611ce8b3cfaffc02e44a69 (patch)
tree98a317234ffe15da1ebfdf0fddd8a0b9ed86f5dc /src/mongo/bson/mutable/element.h
parentda0559f544928c3b56fc3f02cabb912e8c45343f (diff)
downloadmongo-f6b0d41bc6f230822e611ce8b3cfaffc02e44a69.tar.gz
SERVER-8046 Add a new hasChildren method is faster than counting
Diffstat (limited to 'src/mongo/bson/mutable/element.h')
-rw-r--r--src/mongo/bson/mutable/element.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/bson/mutable/element.h b/src/mongo/bson/mutable/element.h
index 30404411c83..8e237284c1d 100644
--- a/src/mongo/bson/mutable/element.h
+++ b/src/mongo/bson/mutable/element.h
@@ -157,6 +157,11 @@ namespace mutablebson {
*/
Element rightChild() const;
+ /** Returns true if this element has children. Always returns false if this Element is
+ * not an Object or Array.
+ */
+ bool hasChildren() const;
+
/** Returns either this Element's left sibling, or a non-ok Element if no left sibling
* exists.
*/