21 #include "mongo/base/status.h"
22 #include "mongo/base/string_data.h"
23 #include "mongo/bson/bsontypes.h"
38 const StringData& fieldName,
39 BSONElement* outElement);
50 const StringData& fieldName,
52 BSONElement* outElement);
107 const StringData& fieldName,
122 const StringData& fieldName,
123 long long defaultValue,
137 const StringData& fieldName,
138 const StringData& defaultValue,
150 const StringData& fieldName,
151 const OID& defaultValue,
Status bsonExtractIntegerFieldWithDefault(const BSONObj &object, const StringData &fieldName, long long defaultValue, long long *out)
Finds an element named "fieldName" in "object" that represents an integral value. ...
Utility functions for parsing numbers from strings.
Definition: compare_numbers.h:20
Status bsonExtractBooleanFieldWithDefault(const BSONObj &object, const StringData &fieldName, bool defaultValue, bool *out)
Finds a bool-like element named "fieldName" in "object".
Status bsonExtractOIDFieldWithDefault(const BSONObj &object, const StringData &fieldName, const OID &defaultValue, OID *out)
Finds an OID-typed element named "fieldName" in "object" and stores its value in *out.
Status bsonExtractBooleanField(const BSONObj &object, const StringData &fieldName, bool *out)
Finds a bool-like element named "fieldName" in "object".
Status bsonExtractTypedField(const BSONObj &object, const StringData &fieldName, BSONType type, BSONElement *outElement)
Finds an element named "fieldName" in "object".
BSONType
the complete list of valid BSON types see also bsonspec.org
Definition: bsontypes.h:38
Status bsonExtractField(const BSONObj &object, const StringData &fieldName, BSONElement *outElement)
Finds an element named "fieldName" in "object".
Status bsonExtractStringField(const BSONObj &object, const StringData &fieldName, std::string *out)
Finds a string-typed element named "fieldName" in "object" and stores its value in "out"...
Status bsonExtractOIDField(const BSONObj &object, const StringData &fieldName, OID *out)
Finds an OID-typed element named "fieldName" in "object" and stores its value in "out".
Status bsonExtractIntegerField(const BSONObj &object, const StringData &fieldName, long long *out)
Finds an element named "fieldName" in "object" that represents an integral value. ...
MONGO_CLIENT_API Status(MONGO_CLIENT_FUNC *saslClientAuthenticate)(DBClientWithCommands *client
Attempts to authenticate "client" using the SASL protocol.
Status bsonExtractStringFieldWithDefault(const BSONObj &object, const StringData &fieldName, const StringData &defaultValue, std::string *out)
Finds a string element named "fieldName" in "object".