Doubt for fields that contanins spaces

In chapter 4 in the section Lab 1: Querying Arrays and Sub-Documents I tried to insert this comand.

db.trips.find({"$or":[{"start_station_location.coordinates":{"$elemMatch":{"0":-74}}},{"end_satation_location.coordinates":{"$elemMatch":{"0":"-74"}}}]})

Unfortunalety,it does not find any elements.

If the field has spaces, you must use spaces. It looks like you replaced the spaces with underlines. That will not work.

1 Like