Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,15 @@ var MongodbDriver = Base.extend({
*/
addIndex: function(collectionName, indexName, columns, unique, callback) {

var options = {
indexName: indexName,
var parameters = {
columns: columns,
unique: unique
options: {
name: indexName,
unique: unique
}
};

return this._run('createIndex', collectionName, options)
return this._run('createIndex', collectionName, parameters)
.nodeify(callback);
},

Expand Down Expand Up @@ -213,7 +215,7 @@ var MongodbDriver = Base.extend({
return this._run('insert', this.internals.seedTable, {name: name, run_on: new Date()})
.nodeify(callback);
},

/**
* Returns the DB instance so custom updates can be made.
* NOTE: This method exceptionally does not call close() on the database driver when the promise resolves. So the getDbInstance method caller
Expand Down Expand Up @@ -323,7 +325,7 @@ var MongodbDriver = Base.extend({
db[command](collection, options.newCollection, callbackFunction);
break;
case 'createIndex':
db[command](collection, options.columns, {name: options.indexName, unique: options.unique}, callbackFunction);
db[command](collection, options.columns, options.options, callbackFunction);
break;
case 'dropIndex':
db.collection(collection)[command](options.indexName, callbackFunction);
Expand Down