Which code example completes this statement and creates an index for a MongoDB object named restaurants, sorted ascending by the field name?

var indexCollection = function(db) {return co(function*() {…});};
  •  const results = yield db.table(‘restaurants’).createIndex({“name”: 1}, null); return results;
  •  const results = yield db.collection(‘restaurants’).createIndex({“name”: 0}, null); return results;
  •  const results = yield db.collection(‘restaurants’).createIndex({“name”: 1}, null); return results;
  •  const results = yield db.table(‘restaurants’).createIndex({“name”: 0}, null); return results;

Leave a Reply

Your email address will not be published. Required fields are marked *