summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun Verch <shaun.verch@10gen.com>2013-04-08 14:21:33 -0700
committerDan Pasette <dan@10gen.com>2013-05-17 16:24:08 -0700
commitc741fd006ce28c59ee7dd4f32c79672a62cc6a82 (patch)
tree57bf952412509665d0334dc9748708815fb00d17
parentcf139b7cb6a3f619fc4577f4f0cd1b773d6e5ec2 (diff)
downloadmongo-c741fd006ce28c59ee7dd4f32c79672a62cc6a82.tar.gz
SERVER-6947 Do not create undefined fields in db.createCollection
-rw-r--r--src/mongo/shell/db.js6
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;
}