SERVER-3565 don't get _id from shard key, get from doc

This commit is contained in:
gregs
2011-10-13 15:23:31 -04:00
parent 5c527e31fb
commit ffa338a9df

View File

@@ -205,20 +205,20 @@ namespace mongo {
if ( key.type() && key.type() != jstNULL )
continue;
BSONObj obj = c->current();
BSONObjIterator j( keyPattern );
BSONElement real;
for ( int x=0; x<n; x++ )
real = j.next();
real = obj.getFieldDotted( real.fieldName() );
if ( real.type() )
continue;
ostringstream os;
os << "found null value in key " << bc->prettyKey( currKey ) << " for doc: " << real["_id"];
os << "found null value in key " << bc->prettyKey( currKey ) << " for doc: " << ( obj["_id"].eoo() ? obj.toString() : obj["_id"].toString() );
log() << "checkShardingIndex for '" << ns << "' failed: " << os.str() << endl;
errmsg = os.str();