0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

SERVER-854: unplugging NumberInt as being automatically created from bson int values, breaks many behaviors

This commit is contained in:
agirbal 2011-07-06 13:27:46 -07:00
parent 7b24e34433
commit a057d6d68e
2 changed files with 6 additions and 3 deletions

View File

@ -58,4 +58,6 @@ assert( 5 == NumberInt( 5 ) , "eq" );
assert( 5 < NumberInt( 6 ) , "lt" );
assert( 5 > NumberInt( 4 ) , "lt" );
assert( NumberInt( 1 ) , "to bool a" );
//assert( ! NumberInt( 0 ) , "to bool b" ); // SERVER-3366
// objects are always considered thruthy
//assert( ! NumberInt( 0 ) , "to bool b" );

View File

@ -591,9 +591,10 @@ namespace mongo {
case Undefined:
return JSVAL_NULL;
case NumberDouble:
return toval( e.number() );
case NumberInt:
return toval( e.numberInt() );
return toval( e.number() );
// case NumberInt:
// return toval( e.numberInt() );
case Symbol: // TODO: should we make a special class for this
case String:
return toval( e.valuestr() );