diff options
Diffstat (limited to 'src/mongo/shell/db.js')
| -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; } |
