mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
find _id index more robustly
This commit is contained in:
parent
c423f4cb6f
commit
aa6fc17f57
@ -587,6 +587,13 @@ namespace mongo {
|
|||||||
id = ⅈ
|
id = ⅈ
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if ( keyPattern.nFields() == 1 && ii.keyPattern().nFields() == 1 &&
|
||||||
|
IndexDetails::isIdIndexPattern( keyPattern ) &&
|
||||||
|
ii.isIdIndex() ){
|
||||||
|
id = ⅈ
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -597,7 +604,7 @@ namespace mongo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( !id ) {
|
if ( !id ) {
|
||||||
errmsg = "no index found for specified keyPattern";
|
errmsg = (string)"no index found for specified keyPattern: " + keyPattern.toString();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user