lib/operations/collection_ops.js
function ensureIndex(coll, fieldOrSpec, options, callback) {
  ensureIndexDb(coll.s.db, coll.s.name, fieldOrSpec, options, callback);
}
function ensureIndex(coll, fieldOrSpec, options, callback) {
  ensureIndexDb(coll.s.db, coll.s.name, fieldOrSpec, options, callback);
}
function ensureIndex ( coll , fieldOrSpec , options , callback ) { ensureIndexDb ( coll . s . db , coll . s . name , fieldOrSpec , options , callback ) ; }
Ensure that an index exists. If the index does not exist, this function creates it.

@method
@param {Collection} a Collection instance.
@param {(string|object)} fieldOrSpec Defines the index.
@param {object} [options] Optional settings. See Collection.prototype.ensureIndex for a list of options.
@param {Collection~resultCallback} [callback] The command result callback
Ensure that an index exists . If the index does not exist this function creates it .