Quotations around field names in video 2.3 Single Field Ind

quotations around field names in video 2.3 Single Field Indexes

exp.find({“ssn”:“720-38-5636”}) time 3:12
exp.find({last_name :“Acevedo”}) time 4:10

why around ssn but not around last_name ??

In this scenario, there’s no particular reason. Perhaps the lecturer was just trying to see if you were paying attention :wink:

Hi @James_58604,

It is not necessary to put quote around all field names. It is optional and you can skip it.
However, if you need to access array fields or embedded documents, you will have to specify the quotes around the field names.

Please let me know, if you have any questions.

Thanks,
Sonali