bsonmisc.h File Reference

Go to the source code of this file.

Classes

struct  mongo::BSONElementCmpWithoutField
class  mongo::BSONObjBuilderValueStream
class  mongo::BSONObjCmp
class  mongo::BSONObjCmpDefaultOrder
class  mongo::BSONSizeTracker
struct  mongo::DateNowLabeler
struct  mongo::GENOIDLabeler
struct  mongo::Labeler::Label
class  mongo::Labeler
struct  mongo::MaxKeyLabeler
struct  mongo::MinKeyLabeler

Namespaces

namespace  mongo

Defines

#define BSON(x)   (( mongo::BSONObjBuilder(64) << x ).obj())
#define BSON_ARRAY(x)   (( mongo::BSONArrayBuilder() << x ).arr())

Typedefs

typedef set< BSONObj,
BSONObjCmpDefaultOrder > 
mongo::BSONObjSetDefaultOrder

Enumerations

enum  mongo::FieldCompareResult {
  mongo::LEFT_SUBFIELD = -2, mongo::LEFT_BEFORE = -1, mongo::SAME = 0, mongo::RIGHT_BEFORE = 1,
  mongo::RIGHT_SUBFIELD = 2
}

Functions

FieldCompareResult mongo::compareDottedFieldNames (const string &l, const string &r)
int mongo::getGtLtOp (const BSONElement &e)
BSONObj mongo::OR (const BSONObj &a, const BSONObj &b, const BSONObj &c, const BSONObj &d, const BSONObj &e, const BSONObj &f)
BSONObj mongo::OR (const BSONObj &a, const BSONObj &b, const BSONObj &c, const BSONObj &d, const BSONObj &e)
BSONObj mongo::OR (const BSONObj &a, const BSONObj &b, const BSONObj &c, const BSONObj &d)
BSONObj mongo::OR (const BSONObj &a, const BSONObj &b, const BSONObj &c)
BSONObj mongo::OR (const BSONObj &a, const BSONObj &b)

Variables

struct mongo::DateNowLabeler mongo::DATENOW
struct mongo::GENOIDLabeler mongo::GENOID
Labeler::Label mongo::GT
Labeler::Label mongo::GTE
Labeler::Label mongo::LT
Labeler::Label mongo::LTE
struct mongo::MaxKeyLabeler mongo::MAXKEY
struct mongo::MinKeyLabeler mongo::MINKEY
Labeler::Label mongo::NE
Labeler::Label mongo::SIZE

Define Documentation

#define BSON (  )     (( mongo::BSONObjBuilder(64) << x ).obj())

Use BSON macro to build a BSONObj from a stream

e.g., BSON( "name" << "joe" << "age" << 33 )

with auto-generated object id: BSON( GENOID << "name" << "joe" << "age" << 33 )

The labels GT, GTE, LT, LTE, NE can be helpful for stream-oriented construction of a BSONObj, particularly when assembling a Query. For example, BSON( "a" << GT << 23.4 << NE << 30 << "b" << 2 ) produces the object { a: { $gt: 23.4, $ne: 30 }, b: 2 }.

Definition at line 70 of file bsonmisc.h.

#define BSON_ARRAY (  )     (( mongo::BSONArrayBuilder() << x ).arr())

Use BSON_ARRAY macro like BSON macro, but without keys

BSONArray arr = BSON_ARRAY( "hello" << 1 << BSON( "foo" << BSON_ARRAY( "bar" << "baz" << "qux" ) ) );

Definition at line 77 of file bsonmisc.h.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


mongodb
Author(s): Nate Koenig
autogenerated on Fri Jan 11 12:15:19 2013