22#include "mongo/bson/bsonelement.h"
23#include "mongo/client/export_macros.h"
27 int getGtLtOp(
const BSONElement& e);
41 BSONObj order()
const {
return _order; }
46 typedef std::set<BSONObj,BSONObjCmp> BSONObjSet;
48 enum FieldCompareResult {
69#define BSON(x) (( ::mongo::BSONObjBuilder(64) << x ).obj())
76#define BSON_ARRAY(x) (( ::mongo::BSONArrayBuilder() << x ).arr())
119 explicit Label(
const char *l ) : l_( l ) {}
139 explicit BSONSymbol(
const StringData& sym) :symbol(sym) {}
145 explicit BSONCode(
const StringData& str) :code(str) {}
158 explicit BSONRegEx(
const StringData& pat,
const StringData& f=
"") :pattern(pat), flags(f) {}
165 BSONBinData(
const void* d,
int l, BinDataType t) :data(d), length(l), type(t) {}
173 BSONDBRef(
const StringData& nameSpace,
const OID& o) :ns(nameSpace), oid(o) {}
217 void endField(
const StringData& nextFieldName = StringData() );
218 bool subobjStarted()
const {
return _fieldName != 0; }
229 StringData _fieldName;
232 bool haveSubobj()
const {
return _subobj.get() != 0; }
234 std::auto_ptr< BSONObjBuilder > _subobj;
244 for (
int i=0; i<SIZE; i++ )
251 void got(
int size ) {
253 _pos = (_pos + 1) % SIZE;
261 for (
int i=0; i<SIZE; i++ ) {
275 bool fieldsMatch(
const BSONObj& lhs,
const BSONObj& rhs);
BSONElement represents an "element" in a BSONObj.
Definition bsonelement.h:55
int woCompare(const BSONElement &e, bool considerFieldName=true) const
Well ordered comparison.
Definition bsonmisc.h:197
Utility for creating a BSONObj.
Definition bsonobjbuilder.h:53
C++ representation of a "BSON" object – that is, an extended JSON-style object in a binary representa...
Definition bsonobj.h:78
int woCompare(const BSONObj &r, const Ordering &o, bool considerFieldName=true) const
wo='well ordered'.
used in conjuction with BSONObjBuilder, allows for proper buffer size to prevent crazy memory usage
Definition bsonmisc.h:240
int getSize() const
right now choosing largest size
Definition bsonmisc.h:259
Definition bsonmisc.h:116
Object ID type.
Definition oid.h:60
the main MongoDB namespace
Definition bulk_operation_builder.h:24
Definition bsonmisc.h:164
Definition bsonmisc.h:150
Definition bsonmisc.h:144
Definition bsonmisc.h:172
Definition bsonmisc.h:157
Definition bsonmisc.h:138
Definition bsonmisc.h:118
Definition bsonmisc.h:112
Definition bsonmisc.h:110
Definition bsonmisc.h:103