mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
validation method MINOR
This commit is contained in:
parent
476820a13e
commit
6f329f6694
@ -8,13 +8,19 @@ if ( ( typeof DBCollection ) == "undefined" ){
|
||||
this._shortName = shortName;
|
||||
this._fullName = fullName;
|
||||
|
||||
assert( this._mongo , "no mongo" );
|
||||
assert( this._db , "no db" );
|
||||
assert( this._shortName , "no shortName" );
|
||||
assert( this._fullName , "no fullName" );
|
||||
this.verify();
|
||||
}
|
||||
}
|
||||
|
||||
DBCollection.prototype.verify = function(){
|
||||
assert( this._mongo , "no mongo" );
|
||||
assert( this._db , "no db" );
|
||||
assert( this._shortName , "no shortName" );
|
||||
assert( this._fullName , "no fullName" );
|
||||
|
||||
assert.eq( this._fullName , this._db._name + "." + this._shortName , "name mismatch" );
|
||||
}
|
||||
|
||||
DBCollection.prototype.getName = function(){
|
||||
return this._shortName;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user