summaryrefslogtreecommitdiff
path: root/jstests/core/rename_stayTemp.js
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2016-03-09 12:17:50 -0500
committerJonathan Abrahams <jonathan@mongodb.com>2016-03-09 12:18:14 -0500
commit4ae691e8edc87d0e3cfb633bb91c328426be007b (patch)
tree52079a593f54382ca13a2e741633eab1b6271893 /jstests/core/rename_stayTemp.js
parenta025d43f3ce2efc1fb1282a718f5d286fa0a4dc1 (diff)
downloadmongo-4ae691e8edc87d0e3cfb633bb91c328426be007b.tar.gz
SERVER-22468 Format JS code with approved style in jstests/
Diffstat (limited to 'jstests/core/rename_stayTemp.js')
-rw-r--r--jstests/core/rename_stayTemp.js25
1 files changed, 12 insertions, 13 deletions
diff --git a/jstests/core/rename_stayTemp.js b/jstests/core/rename_stayTemp.js
index ccada6abf39..d8451af2d2d 100644
--- a/jstests/core/rename_stayTemp.js
+++ b/jstests/core/rename_stayTemp.js
@@ -4,17 +4,19 @@ dest = 'rename_stayTemp_dest';
db[orig].drop();
db[dest].drop();
-function ns(coll){ return db[coll].getFullName(); }
+function ns(coll) {
+ return db[coll].getFullName();
+}
-function istemp( name ) {
- var result = db.runCommand( "listCollections", { filter : { name : name } } );
- assert( result.ok );
- var collections = new DBCommandCursor( db.getMongo(), result ).toArray();
- assert.eq( 1, collections.length );
+function istemp(name) {
+ var result = db.runCommand("listCollections", {filter: {name: name}});
+ assert(result.ok);
+ var collections = new DBCommandCursor(db.getMongo(), result).toArray();
+ assert.eq(1, collections.length);
return collections[0].options.temp ? true : false;
}
-db.runCommand({create: orig, temp:1});
+db.runCommand({create: orig, temp: 1});
assert(istemp(orig));
db.adminCommand({renameCollection: ns(orig), to: ns(dest)});
@@ -22,11 +24,8 @@ assert(!istemp(dest));
db[dest].drop();
-db.runCommand({create: orig, temp:1});
-assert( istemp(orig) );
+db.runCommand({create: orig, temp: 1});
+assert(istemp(orig));
db.adminCommand({renameCollection: ns(orig), to: ns(dest), stayTemp: true});
-assert( istemp(dest) );
-
-
-
+assert(istemp(dest));