Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Submitted
Categories Database
Created by Guest
Created on Aug 6, 2020

Ability to enable collection name enforcement

Currently if you perform a find or other operation, and you have a typo in your collection name, the operation will execute successfully and there is no indication that the collection you are operating on doesn't exist. It would be handy if there were some sort of session variable that could be set that tells the engine, to return an error if the collection being operated on does not exist. For example, lets say we have a collection named "myCollection". If I issue a find with a typo in the collection name from the shell like: db.myCollectio.find(); This will successfully run and return no records even though "myCollectio" doesn't exist. If there were some way to say, I want to enforce and check that the collection actually exists as part of the collection operation such that if the above command were issues, and error would be thrownindicating "myCollectio" does not exist. This would save a lot of troubleshooting headaches in that people don't always realize there is a typo in their collection name. I'm not sure if this would be a database engine modification or a shell modification.
  • Attach files