22 #include "mongo/bson/bsonelement.h"
23 #include "mongo/client/export_macros.h"
27 int getGtLtOp(
const BSONElement& e);
49 typedef std::set<BSONObj, BSONObjCmp> BSONObjSet;
51 enum FieldCompareResult {
72 #define BSON(x) ((::mongo::BSONObjBuilder(64) << x).obj())
80 #define BSON_ARRAY(x) ((::mongo::BSONArrayBuilder() << x).arr())
123 explicit Label(
const char* l) : l_(l) {}
144 explicit BSONSymbol(
const StringData& sym) : symbol(sym) {}
150 explicit BSONCode(
const StringData& str) : code(str) {}
163 explicit BSONRegEx(
const StringData& pat,
const StringData& f =
"") : pattern(pat), flags(f) {}
170 BSONBinData(
const void* d,
int l, BinDataType t) : data(d), length(l), type(t) {}
178 BSONDBRef(
const StringData& nameSpace,
const OID& o) : ns(nameSpace), oid(o) {}
228 void endField(
const StringData& nextFieldName = StringData());
229 bool subobjStarted()
const {
230 return _fieldName != 0;
245 StringData _fieldName;
248 bool haveSubobj()
const {
249 return _subobj.get() != 0;
252 std::auto_ptr<BSONObjBuilder> _subobj;
263 for (
int i = 0; i < SIZE; i++)
271 _pos = (_pos + 1) % SIZE;
279 for (
int i = 0; i < SIZE; i++) {
293 bool fieldsMatch(
const BSONObj& lhs,
const BSONObj& rhs);
Definition: bsonmisc.h:155
Definition: bsonmisc.h:143
the main MongoDB namespace
Definition: bulk_operation_builder.h:24
Definition: bsonmisc.h:35
Definition: bsonmisc.h:122
Object ID type.
Definition: oid.h:60
int woCompare(const BSONObj &r, const Ordering &o, bool considerFieldName=true) const
wo='well ordered'.
Definition: bsonmisc.h:86
used in conjuction with BSONObjBuilder, allows for proper buffer size to prevent crazy memory usage ...
Definition: bsonmisc.h:259
Definition: bsonmisc.h:29
Definition: bsonmisc.h:100
Utility for creating a BSONObj.
Definition: bsonobjbuilder.h:53
Definition: bsonmisc.h:149
Definition: bsonmisc.h:114
Definition: bsonmisc.h:107
int getSize() const
right now choosing largest size
Definition: bsonmisc.h:277
Definition: bsonmisc.h:169
Definition: bsonmisc.h:93
Definition: bsonmisc.h:162
Definition: bsonmisc.h:177
BSONElement represents an "element" in a BSONObj.
Definition: bsonelement.h:55
Definition: bsonmisc.h:116
int woCompare(const BSONElement &e, bool considerFieldName=true) const
Well ordered comparison.
Definition: bsonmisc.h:120
C++ representation of a "BSON" object – that is, an extended JSON-style object in a binary represent...
Definition: bsonobj.h:78
Definition: bsonmisc.h:208