summaryrefslogtreecommitdiff
path: root/src/mongo/bson/bsonelement.h
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2016-05-04 19:16:43 -0400
committerAndrew Morrow <acm@mongodb.com>2016-05-05 16:15:25 -0400
commita7e243500cbf11d1e153f55b551c86713ddf2a9b (patch)
tree7dea0a249a42350afe2d6b94c52c180feaa8763b /src/mongo/bson/bsonelement.h
parentd5b670a01622ff5b9cd8dc1a988321022948182b (diff)
downloadmongo-a7e243500cbf11d1e153f55b551c86713ddf2a9b.tar.gz
SERVER-16801 Require strict equality for $set no-op checks
Diffstat (limited to 'src/mongo/bson/bsonelement.h')
-rw-r--r--src/mongo/bson/bsonelement.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mongo/bson/bsonelement.h b/src/mongo/bson/bsonelement.h
index 8db2f2f7722..8798fc58794 100644
--- a/src/mongo/bson/bsonelement.h
+++ b/src/mongo/bson/bsonelement.h
@@ -486,6 +486,20 @@ public:
return !operator==(r);
}
+ /**
+ * Compares the raw bytes of the two BSONElements, including the field names. This will treat
+ * different types (e.g. integers and doubles) as distinct values, even if they have the same
+ * field name and bit pattern in the value portion of the BSON element.
+ */
+ bool binaryEqual(const BSONElement& rhs) const;
+
+ /**
+ * Compares the raw bytes of the two BSONElements, excluding the field names. This will treat
+ * different types (e.g integers and doubles) as distinct values, even if they have the same bit
+ * pattern in the value portion of the BSON element.
+ */
+ bool binaryEqualValues(const BSONElement& rhs) const;
+
/** Well ordered comparison.
@return <0: l<r. 0:l==r. >0:l>r
order by type, field name, and field value.