Right now no index's are being created at all.
I debugged into the following call:
self.collection.ensureIndex(index[0], options, tick(function (err) {
if (err) return done(err);
create();
}));where index[0] is
{
background:true,
safe: undefined,
unique: true
}
and I get the error:
"no index name specified"
Then I debugged into the createIndex method on the mongo client and sure enough the mongo command createCreateIndexCommand was failing to get an index name:
var createCreateIndexCommand = function(db, name, fieldOrSpec, options) {
var indexParameters = parseIndexOptions(fieldOrSpec);
var fieldHash = indexParameters.fieldHash;
var keys = indexParameters.keys;
// Generate the index name
var indexName = typeof options.name == 'string' ? options.name : indexParameters.name;
I then tracked it down to the following method in the Utils class
else if(isObject(fieldOrSpec)
which is:
var isObject = exports.isObject = function (arg) {
return '[object Object]' == toString.call(arg)
}
and in this case we are passing an object but "toString.call(arg)" is returning "new" instead of [object Object]
I testing a quick change and updated the code in utils.js:
var isObject = exports.isObject = function (arg) {
return 'object' === typeof arg;
}
and like magic all of my indexes were created.
So I am guessing this might be a driver issue?
I am a little out of my realm here how to proceed.