I have been trying to pass this challenge but to no success. The output looks like this:
// running tests
E11000 duplicate key error collection: test.people index: favoriteFoods_1 dup key: { : "burrito" }
// tests completed
Can someone help me with this?
var queryChain = function(done) {
var foodToSearch = "burrito";
Person.find({favoriteFoods: foodToSearch})
.sort({name: "asc"})
.limit(2)
.select({age: 0})
.exec((err, data) => err ? done(err) : done(null, data));
};