20#include "mongo/bson/bsonobj.h"
21#include "mongo/bson/bsonobjiterator.h"
46 int get(
int i)
const {
47 return ((1 << i) & bits) ? -1 : 1;
51 unsigned descending(
unsigned mask)
const {
62 static Ordering make(
const BSONObj& obj) {
64 BSONObjIterator k(obj);
67 BSONElement e = k.next();
70 uassert(13103,
"too many compound keys", n <= 31);
A precomputation of a BSON index or sort key pattern.
Definition ordering.h:32
int get(int i) const
so, for key pattern { a : 1, b : -1 } get(0) == 1 get(1) == -1
Definition ordering.h:46
the main MongoDB namespace
Definition bulk_operation_builder.h:24