What does the third parameter in the following mongoose query do? What does the third parameter in the following mongoose query do? mongoose mongoose

What does the third parameter in the following mongoose query do?


How you search for name.last in occupation?

The person schema seems to have 2 fields name and occupation. The name is further divided into first and last.The occupation field isn't having any further parts ,that's why person.occupation is returning a string. Had it been divided into further parts then person.occupation would have returned an object.

What would the Person schema look like?

var personSchema = mongoose.Schema({name: {  first: String,  last: String},occupation: String  });