[Solved] Hyphens in mongoDB document string

I have a collection of customers

One has a title “CO-1”

However, this doesn’t return anything Customers.findOne({title: "“CO-1”});

Does mongo have issues with special characters in basic finds?

No it doesn’t

Is this happening on the client? I’m guessing the data hasn’t arrived yet from your publication?


I am using apollo

I was doing a “check if customer name is already being used” immediately after creating one and it wasn’t working… low and behold apollo was using a cached query. I just had to switch fetchPolicy to network-only and it’s good. It wasn’t a mongo issue at all. I spoke too soon.

1 Like