diff options
Diffstat (limited to 'src/mongo/bson/mutable/element.h')
-rw-r--r-- | src/mongo/bson/mutable/element.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mongo/bson/mutable/element.h b/src/mongo/bson/mutable/element.h index 673180c0c64..68bf99dfc08 100644 --- a/src/mongo/bson/mutable/element.h +++ b/src/mongo/bson/mutable/element.h @@ -258,7 +258,7 @@ public: bool hasValue() const; /** Returns true if this element is a numeric type (e.g. NumberLong). Currently, the - * only numeric BSON types are NumberLong, NumberInt, and NumberDouble. + * only numeric BSON types are NumberLong, NumberInt, NumberDouble, and NumberDecimal. */ bool isNumeric() const; @@ -324,6 +324,9 @@ public: /** Get the value from a long valued Element. */ inline int64_t getValueLong() const; + /** Get the value from a decimal valued Element. */ + inline Decimal128 getValueDecimal() const; + /** Returns true if this Element is the min key type. */ inline bool isValueMinKey() const; @@ -444,6 +447,9 @@ public: /** Set the value of this Element to the given long integer */ Status setValueLong(int64_t value); + /** Set the value of this Element to the given decimal. */ + Status setValueDecimal(Decimal128 value); + /** Set the value of this Element to MinKey. */ Status setValueMinKey(); @@ -567,6 +573,9 @@ public: /** Append the provided long integer as a new field with the provided name. */ Status appendLong(StringData fieldName, int64_t value); + /** Append the provided decimal as a new field with the provided name. */ + Status appendDecimal(StringData fieldName, Decimal128 value); + /** Append a max key as a new field with the provided name. */ Status appendMinKey(StringData fieldName); |