Public Member Functions | |
BSONArray (const BSONObj &obj) | |
Public Member Functions inherited from bson::BSONObj | |
BSONObj (const char *msgdata, bool check=true) | |
Construct a BSONObj from data in the proper format. | |
BSONObj (holder_type holder) | |
Construct a BSONObj from data in the proper format. | |
BSONObj () | |
Construct an empty BSONObj – that is, {}. | |
bool | isOwned () const |
A BSONObj can use a buffer it "owns" or one it does not. | |
BSONObj | getOwned () const |
assure the data buffer is under the control of this BSONObj and not a remote buffer | |
BSONObj | copy () const |
string | toString (bool isArray=false, bool full=false, bool noThrow=true) const |
Readable representation of a BSON object in an extended JSON-style notation. | |
void | toString (StringBuilder &s, bool isArray=false, bool full=false) const |
string | jsonString (JsonStringFormat format=Strict, int pretty=0) const |
Properly formatted JSON string. | |
int | addFields (BSONObj &from, set< string > &fields) |
note: addFields always adds _id even if not specified | |
int | nFields () const |
returns # of top level fields in the object note: iterates to count the fields | |
int | getFieldNames (set< string > &fields) const |
adds the field names to the fields set. | |
bool | hasAllFieldNames (const BSONObj &obj) const |
If current obj has all fields in param obj, return true. | |
BSONElement | getFieldDotted (const char *name) const |
BSONElement | getFieldDotted (const string &name) const |
void | getFieldsDotted (const StringData &name, BSONElementSet &ret) const |
Like getFieldDotted(), but expands arrays and returns all matching objects. | |
void | getFieldsDotted (const StringData &name, BSONElementMSet &ret) const |
BSONElement | getFieldDottedOrArray (const char *&name) const |
Like getFieldDotted(), but returns first array encountered while traversing the dotted fields of name. | |
BSONElement | getField (const StringData &name) const |
Get the field of the specified name. | |
BSONElement | getField (const char *name) const |
void | getFields (unsigned n, const char **fieldNames, BSONElement *fields) const |
Get several fields at once. | |
BSONElement | operator[] (const char *field) const |
Get the field of the specified name. | |
BSONElement | operator[] (const string &field) const |
BSONElement | operator[] (int field) const |
bool | hasField (const char *name) const |
bool | hasElement (const char *name) const |
const char * | getStringField (const char *name) const |
BSONObj | getObjectField (const char *name) const |
BSONObj | getObjectField (const StringData &name) const |
int | getIntField (const char *name) const |
bool | getBoolField (const char *name) const |
BSONObj | extractFieldsUnDotted (BSONObj pattern) const |
sets element field names to empty string If a field in pattern is missing, it is omitted from the returned object. | |
BSONObj | extractFields (const BSONObj &pattern, bool fillWithNull=false) const |
extract items from object which match a pattern object. | |
BSONObj | filterFieldsUndotted (const BSONObj &filter, bool inFilter) const |
BSONElement | getFieldUsingIndexNames (const char *fieldName, const BSONObj &indexKey) const |
const char * | objdata () const |
int | objsize () const |
bool | isValid () const |
performs a cursory check on the object's size only. | |
bool | okForStorage () const |
bool | isEmpty () const |
void | dump () const |
string | hexDump () const |
Alternative output format. | |
int | woCompare (const BSONObj &r, const Ordering &o, bool considerFieldName=true) const |
wo='well ordered'. | |
int | woCompare (const BSONObj &r, const BSONObj &ordering=BSONObj(), bool considerFieldName=true) const |
wo='well ordered'. | |
bool | operator< (const BSONObj &other) const |
bool | operator<= (const BSONObj &other) const |
bool | operator> (const BSONObj &other) const |
bool | operator>= (const BSONObj &other) const |
int | woSortOrder (const BSONObj &r, const BSONObj &sortKey, bool useDotted=false) const |
bool | equal (const BSONObj &r) const |
bool | shallowEqual (const BSONObj &r) const |
This is "shallow equality" – ints and doubles won't match. | |
BSONElement | firstElement () const |
const char * | firstElementFieldName () const |
faster than firstElement().fieldName() - for the first element we can easily find the fieldname without computing the element size. | |
bool | getObjectID (BSONElement &e) const |
Get the _id field from the object. | |
int | hash () const |
BSONObj | clientReadable () const |
BSONObj | replaceFieldNames (const BSONObj &obj) const |
Return new object with the field names replaced by those in the passed object. | |
bool | valid () const |
true unless corrupt | |
string | md5 () const |
bool | operator== (const BSONObj &other) const |
void | elems (vector< BSONElement > &) const |
add all elements of the object to the specified vector | |
void | elems (list< BSONElement > &) const |
add all elements of the object to the specified list | |
template<class T > | |
void | Vals (vector< T > &) const |
add all values of the object to the specified vector. | |
template<class T > | |
void | Vals (list< T > &) const |
add all values of the object to the specified list. | |
template<class T > | |
void | vals (vector< T > &) const |
add all values of the object to the specified vector. | |
template<class T > | |
void | vals (list< T > &) const |
add all values of the object to the specified list. | |
BSONObjIterator | begin () const |
use something like this: for( BSONObj::iterator i = myObj.begin(); i.more(); ) { BSONElement e = i.next(); ... | |
void | appendSelfToBufBuilder (BufBuilder &b) const |
void | init (const char *data, bool check=true) |
initialize from existing buffer | |
Additional Inherited Members | |
Public Types inherited from bson::BSONObj | |
enum | MatchType { Equality = 0, LT = 0x1, LTE = 0x3, GTE = 0x6, GT = 0x4, opIN = 0x8, NE = 0x9, opSIZE = 0x0A, opALL = 0x0B, NIN = 0x0C, opEXISTS = 0x0D, opMOD = 0x0E, opTYPE = 0x0F, opREGEX = 0x10, opOPTIONS = 0x11, opELEM_MATCH = 0x12, opNEAR = 0x13, opWITHIN = 0x14, opMAX_DISTANCE =0x15, opISNULL =0x16 } |
typedef bson_intrusive_ptr < Holder, TrivialAllocator > | holder_type |
typedef BSONObjIterator | iterator |
Static Public Member Functions inherited from bson::BSONObj | |
static void | setJSCompatibility (bool compatible) |
when this value is not zero, the BSONObje::toString() method will show the string which is the same with that shows in sdb shell. | |
static bool | getJSCompatibility () |
get whether bson_print method will show the string which is the same with that shows in sdb shell or not | |