QueryPlanSummary QueryPlan::summary() const { QueryPlanSummary summary; summary.fieldRangeSetMulti.reset( new FieldRangeSet( multikeyFrs() ) ); summary.keyFieldsOnly = keyFieldsOnly(); summary.scanAndOrderRequired = scanAndOrderRequired(); return summary; }
BSONObj ResponseBuildStrategy::current( bool allowCovered ) const { if ( _parsedQuery.returnKey() ) { BSONObjBuilder bob; bob.appendKeys( _cursor->indexKeyPattern(), _cursor->currKey() ); return bob.obj(); } if ( allowCovered ) { const Projection::KeyOnly *fields = keyFieldsOnly(); if ( fields ) { return fields->hydrate( _cursor->currKey() ); } } BSONObj ret = _cursor->current(); verify( ret.isValid() ); return ret; }