0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00

SERVER-3176: autoIndexId not passed if not defined to let DB decide

This commit is contained in:
agirbal 2011-07-11 11:42:14 -07:00
parent 330cbb6841
commit 48342721bb
2 changed files with 4 additions and 6 deletions

View File

@ -134,10 +134,9 @@ DB.prototype.auth = function( username , pass ){
*/
DB.prototype.createCollection = function(name, opt) {
var options = opt || {};
var autoIndexId = true;
var cmd = { create: name, capped: options.capped, size: options.size, max: options.max };
if (options.autoIndexId != undefined)
autoIndexId = options.autoIndexId;
var cmd = { create: name, capped: options.capped, size: options.size, max: options.max, autoIndexId: autoIndexId };
cmd.autoIndexId = options.autoIndexId;
var res = this._dbCommand(cmd);
return res;
}

View File

@ -1831,10 +1831,9 @@ const StringData _jscode_raw_db =
"*/\n"
"DB.prototype.createCollection = function(name, opt) {\n"
"var options = opt || {};\n"
"var autoIndexId = true;\n"
"var cmd = { create: name, capped: options.capped, size: options.size, max: options.max };\n"
"if (options.autoIndexId != undefined)\n"
"autoIndexId = options.autoIndexId;\n"
"var cmd = { create: name, capped: options.capped, size: options.size, max: options.max, autoIndexId: autoIndexId };\n"
"cmd.autoIndexId = options.autoIndexId;\n"
"var res = this._dbCommand(cmd);\n"
"return res;\n"
"}\n"