diff options
author | Shaun Verch <shaun.verch@10gen.com> | 2013-04-08 14:21:33 -0700 |
---|---|---|
committer | Dan Pasette <dan@10gen.com> | 2013-05-17 16:24:08 -0700 |
commit | c741fd006ce28c59ee7dd4f32c79672a62cc6a82 (patch) | |
tree | 57bf952412509665d0334dc9748708815fb00d17 | |
parent | cf139b7cb6a3f619fc4577f4f0cd1b773d6e5ec2 (diff) | |
download | mongo-c741fd006ce28c59ee7dd4f32c79672a62cc6a82.tar.gz |
SERVER-6947 Do not create undefined fields in db.createCollection
-rw-r--r-- | src/mongo/shell/db.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mongo/shell/db.js b/src/mongo/shell/db.js index c343f9b6615..a41172ecf1e 100644 --- a/src/mongo/shell/db.js +++ b/src/mongo/shell/db.js @@ -269,11 +269,15 @@ DB.prototype.auth = function() { */ DB.prototype.createCollection = function(name, opt) { var options = opt || {}; - var cmd = { create: name, capped: options.capped, size: options.size }; + var cmd = { create: name }; if (options.max != undefined) cmd.max = options.max; if (options.autoIndexId != undefined) cmd.autoIndexId = options.autoIndexId; + if (options.capped != undefined) + cmd.capped = options.capped; + if (options.size != undefined) + cmd.size = options.size; var res = this._dbCommand(cmd); return res; } |