Onelinerhub / onelinerhub

Thousands of code solutions with clear explanation @ onelinerhub.com
https://onelinerhub.com
MIT License
810 stars 161 forks source link

Fix code for Mongo -> use "exists" operator #1987

Open nonunicorn opened 1 year ago

nonunicorn commented 1 year ago

Here it's better to use "$exists" instead of "findOne" https://onelinerhub.com/mongodb/how-to-check-if-a-document-exists-in-mongodb