26 — NamespaceNotFound
queryconfiguration
The target collection or namespace does not exist
What is happening?
NamespaceNotFound is returned when an operation targets a collection or database that does not exist. MongoDB normally creates collections implicitly on first write, so this error typically appears with operations that require the collection to already exist, such as creating an index on a non-existent collection or running certain administrative commands.
Common causes
- Running a command against a collection that was dropped
- Typo in the collection or database name
- Attempting to create an index before the collection exists
- Application code referencing a collection name that differs from the actual collection
- The collection exists in a different database