#include <projection.h>
Classes | |
class | KeyOnly |
Public Member Functions | |
KeyOnly * | checkKey (const BSONObj &keyPattern) const |
BSONObj | getSpec () const |
void | init (const BSONObj &spec) |
Projection () | |
void | transform (const BSONObj &in, BSONObjBuilder &b) const |
BSONObj | transform (const BSONObj &in) const |
Private Types | |
typedef map< string, boost::shared_ptr< Projection > > | FieldMap |
Private Member Functions | |
void | add (const string &field, int skip, int limit) |
void | add (const string &field, bool include) |
void | append (BSONObjBuilder &b, const BSONElement &e) const |
void | appendArray (BSONObjBuilder &b, const BSONObj &a, bool nested=false) const |
Private Attributes | |
FieldMap | _fields |
bool | _hasNonSimple |
bool | _include |
bool | _includeID |
int | _limit |
int | _skip |
BSONObj | _source |
bool | _special |
given a document and a projection specification can transform the document currently supports specifying which fields and $slice
Definition at line 30 of file projection.h.
typedef map<string, boost::shared_ptr<Projection> > mongo::Projection::FieldMap [private] |
Definition at line 114 of file projection.h.
mongo::Projection::Projection | ( | ) | [inline] |
Definition at line 57 of file projection.h.
void mongo::Projection::add | ( | const string & | field, | |
int | skip, | |||
int | limit | |||
) | [private] |
void mongo::Projection::add | ( | const string & | field, | |
bool | include | |||
) | [private] |
void mongo::Projection::append | ( | BSONObjBuilder & | b, | |
const BSONElement & | e | |||
) | const [private] |
appends e to b if user wants it will descend into e if needed
void mongo::Projection::appendArray | ( | BSONObjBuilder & | b, | |
const BSONObj & | a, | |||
bool | nested = false | |||
) | const [private] |
BSONObj mongo::Projection::getSpec | ( | ) | const [inline] |
Definition at line 75 of file projection.h.
void mongo::Projection::init | ( | const BSONObj & | spec | ) |
called once per lifetime e.g. { "x" : 1 , "a.y" : 1 }
void mongo::Projection::transform | ( | const BSONObj & | in, | |
BSONObjBuilder & | b | |||
) | const |
transforms in according to spec
FieldMap mongo::Projection::_fields [private] |
Definition at line 115 of file projection.h.
bool mongo::Projection::_hasNonSimple [private] |
Definition at line 123 of file projection.h.
bool mongo::Projection::_include [private] |
Definition at line 110 of file projection.h.
bool mongo::Projection::_includeID [private] |
Definition at line 117 of file projection.h.
int mongo::Projection::_limit [private] |
Definition at line 121 of file projection.h.
int mongo::Projection::_skip [private] |
Definition at line 120 of file projection.h.
BSONObj mongo::Projection::_source [private] |
Definition at line 116 of file projection.h.
bool mongo::Projection::_special [private] |
Definition at line 111 of file projection.h.