mongo::Projection Class Reference

#include <projection.h>

List of all members.

Classes

class  KeyOnly

Public Member Functions

KeyOnlycheckKey (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

Detailed Description

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.


Member Typedef Documentation

typedef map<string, boost::shared_ptr<Projection> > mongo::Projection::FieldMap [private]

Definition at line 114 of file projection.h.


Constructor & Destructor Documentation

mongo::Projection::Projection (  )  [inline]

Definition at line 57 of file projection.h.


Member Function Documentation

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]
KeyOnly* mongo::Projection::checkKey ( const BSONObj keyPattern  )  const
Returns:
if the keyPattern has all the information needed to return then return a new KeyOnly otherwise null NOTE: a key may have modified the actual data which has to be handled above this (arrays, geo)
BSONObj mongo::Projection::getSpec (  )  const [inline]
Returns:
the spec init was called with

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

BSONObj mongo::Projection::transform ( const BSONObj in  )  const

transforms in according to spec


Member Data Documentation

Definition at line 115 of file projection.h.

Definition at line 123 of file projection.h.

Definition at line 110 of file projection.h.

Definition at line 117 of file projection.h.

Definition at line 121 of file projection.h.

int mongo::Projection::_skip [private]

Definition at line 120 of file projection.h.

Definition at line 116 of file projection.h.

Definition at line 111 of file projection.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


mongodb
Author(s): Nate Koenig
autogenerated on Fri Jan 11 12:15:57 2013