diff options
author | Geert Bosch <geert@mongodb.com> | 2017-06-15 00:20:33 -0400 |
---|---|---|
committer | Geert Bosch <geert@mongodb.com> | 2017-06-23 15:11:09 -0400 |
commit | a69ae445303fc4821c6745866b3902623a385c1c (patch) | |
tree | 177cab03d8078defe675fd0dff15349cc32401c0 /src/mongo/bson/bsonobj.h | |
parent | 3bb0f6030b5609002049ea2156e97fe4c6c05d5d (diff) | |
download | mongo-a69ae445303fc4821c6745866b3902623a385c1c.tar.gz |
SERVER-27992 Use UUIDs for replication
Diffstat (limited to 'src/mongo/bson/bsonobj.h')
-rw-r--r-- | src/mongo/bson/bsonobj.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/bson/bsonobj.h b/src/mongo/bson/bsonobj.h index 8d62bc8fd3d..15e2326c0db 100644 --- a/src/mongo/bson/bsonobj.h +++ b/src/mongo/bson/bsonobj.h @@ -245,6 +245,13 @@ public: /** note: addFields always adds _id even if not specified */ int addFields(BSONObj& from, std::set<std::string>& fields); /* returns n added */ + /** + * Add specific field to the end of the object if it did not exist, otherwise replace it + * preserving original field order. Returns newly built object. Returns copy of this for empty + * field. + */ + BSONObj addField(const BSONElement& field) const; + /** remove specified field and return a new object with the remaining fields. slowish as builds a full new object */ |