This commit is contained in:
Dwight
2010-06-10 18:02:17 -04:00
parent 210f105e49
commit dedf707197
4 changed files with 180 additions and 3 deletions

View File

@@ -73,11 +73,9 @@ namespace mongo {
BSONObj encapsulate( const BSONObj &obj ) {
return BSON( "" << obj );
}
// real methods
mongo::BSONObj JSSleep(const mongo::BSONObj &args){
assert( args.nFields() == 1 );
assert( args.firstElement().isNumber() );
@@ -181,6 +179,10 @@ namespace mongo {
return BSON( "" << p.string() );
}
BSONObj hostname(const BSONObj&) {
return BSON( "" << getHostName() );
}
BSONObj removeFile(const BSONObj& args){
uassert( 12597 , "need to specify 1 argument" , args.nFields() == 1 );
@@ -719,6 +721,7 @@ namespace mongo {
scope.injectNative( "listFiles" , listFiles );
scope.injectNative( "ls" , ls );
scope.injectNative( "pwd", pwd );
scope.injectNative( "hostname", hostname);
scope.injectNative( "resetDbpath", ResetDbpath );
scope.injectNative( "copyDbpath", CopyDbpath );
#endif