20#include "mongo/bson/bsonobj.h"
21#include "mongo/bson/bsonobjiterator.h"
45 int get(
int i)
const {
46 return ((1 << i) & bits) ? -1 : 1;
50 unsigned descending(
unsigned mask)
const {
return bits & mask; }
59 static Ordering make(
const BSONObj& obj) {
61 BSONObjIterator k(obj);
64 BSONElement e = k.next();
67 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:45
the main MongoDB namespace
Definition bulk_operation_builder.h:24