Say i have people collection,
{
"_id":{
"$oid":"57d7a184fa937f710a7e017a"
},
"last_name":"Acosta",
"quote":"Ab quasi ullam vel sapiente eum unde nihil voluptates.",
"job":"Clinical cytogeneticist",
"ssn":"603-27-7608",
"address":{
"city":"West Danielle",
"state":"Connecticut",
"street":"87093 Jackson Corner",
"zip":"96100-0593"
},
"first_name":"Renee",
"company_id":{
"$oid":"57d7a184fa937f710a7e016f"
},
"employer":"Smith, Jones and Alvarado",
"birthday":{
"$date":"2010-09-05T10:15:51.000Z"
},
"email":"katie97@walters-mann.com"
}
I want to write a query to fetch all people whose first_name starts with A or all people living in city Connecticut . What kind of index should i use , can i even use index to optimize this query.
indent preformatted text by 4 spaces