SERVER-2031: setSlaveOk at each level in shell

This commit is contained in:
agirbal
2011-09-20 22:58:58 -07:00
parent 55351e6fc8
commit b9d4ce580e
8 changed files with 77 additions and 17 deletions

View File

@@ -245,13 +245,12 @@ namespace mongo {
int nToReturn = (int) c.toNumber( argv[3] );
int nToSkip = (int) c.toNumber( argv[4] );
bool slaveOk = c.getBoolean( obj , "slaveOk" );
int batchSize = (int) c.toNumber( argv[5] );
int options = (int)c.toNumber( argv[6] );
try {
auto_ptr<DBClientCursor> cursor = conn->query( ns , q , nToReturn , nToSkip , f.nFields() ? &f : 0 , options | ( slaveOk ? QueryOption_SlaveOk : 0 ) , batchSize );
auto_ptr<DBClientCursor> cursor = conn->query( ns , q , nToReturn , nToSkip , f.nFields() ? &f : 0 , options , batchSize );
if ( ! cursor.get() ) {
log() << "query failed : " << ns << " " << q << " to: " << conn->toString() << endl;
JS_ReportError( cx , "error doing query: failed" );
@@ -1066,7 +1065,7 @@ zzz
c.setProperty( obj , "_batchSize" , JSVAL_ZERO );
if ( argc > 9 && JSVAL_IS_NUMBER( argv[9] ) )
c.setProperty( obj , "_options" , argv[8] );
c.setProperty( obj , "_options" , argv[9] );
else
c.setProperty( obj , "_options" , JSVAL_ZERO );