mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
errorHandling for median key
This commit is contained in:
parent
7109189774
commit
d1427f7232
@ -811,13 +811,18 @@ namespace mongo {
|
||||
BSONObj max = jsobj.getObjectField( "max" );
|
||||
|
||||
if ( ns[ 0 ] == '\0' || min.isEmpty() || max.isEmpty() ) {
|
||||
errmsg = "invalid command syntax";
|
||||
errmsg = "invalid command syntax (note: min and max are required)";
|
||||
return false;
|
||||
}
|
||||
|
||||
setClient( ns );
|
||||
const IndexDetails *id = 0;
|
||||
NamespaceDetails *d = nsdetails( ns );
|
||||
if ( ! d ){
|
||||
errmsg = "ns not found";
|
||||
return false;
|
||||
}
|
||||
|
||||
BSONObj keyPattern = jsobj.getObjectField( "keyPattern" );
|
||||
if ( keyPattern.isEmpty() ) {
|
||||
BSONObjIterator i( min );
|
||||
|
Loading…
Reference in New Issue
Block a user