don't do de duping for capped collections

This commit is contained in:
Aaron
2009-05-14 11:30:13 -04:00
parent ec0b50ddbd
commit a23f4a3138
4 changed files with 29 additions and 11 deletions

View File

@@ -822,16 +822,18 @@ namespace mongo {
}
else {
BSONObj js = c->current();
BSONElement idRef = js.getField( "_id" );
if ( !idRef.eoo() ) {
BSONObjBuilder idBuilder;
idBuilder.append( idRef );
BSONObj id = idBuilder.obj();
if ( cc->ids_->get( id ) ) {
c->advance();
continue;
if ( cc->ids_.get() ) {
BSONElement idRef = js.getField( "_id" );
if ( !idRef.eoo() ) {
BSONObjBuilder idBuilder;
idBuilder.append( idRef );
BSONObj id = idBuilder.obj();
if ( cc->ids_->get( id ) ) {
c->advance();
continue;
}
cc->ids_->put( id );
}
cc->ids_->put( id );
}
bool ok = fillQueryResultFromObj(b, cc->filter.get(), js);
if ( ok ) {
@@ -1043,7 +1045,7 @@ namespace mongo {
bool mayCreateCursor1 = wantMore_ && ntoreturn_ != 1 && useCursors;
if ( ( mayCreateCursor1 || mayCreateCursor2() ) && !ids_.get() ) {
if ( !ids_.get() && !c_->capped() && ( mayCreateCursor1 || mayCreateCursor2() ) ) {
ids_.reset( new IdSet() );
}