|
|
@ -183,6 +183,8 @@ Collection.prototype.dropIndex = function(index, cb) { |
|
|
|
Collection.prototype.createIndex = function(index, opts, cb) { |
|
|
|
if (typeof opts === 'function') return this.createIndex(index, {}, opts); |
|
|
|
if (typeof opts === 'undefined') return this.createIndex(index, {}, noop); |
|
|
|
if (typeof cb === 'undefined') return this.createIndex(index, opts, noop); |
|
|
|
|
|
|
|
opts.name = indexName(index); |
|
|
|
opts.key = index; |
|
|
|
this.runCommand('createIndexes', {indexes: [opts]}, cb); |
|
|
|