48 — NamespaceExists
configurationwrite
A collection or index with this name already exists
What is happening?
NamespaceExists is returned when attempting to create a collection, view, or index that already exists. For collections, this happens when explicitly calling createCollection on an existing name. For indexes, it happens when creating an index with a name that already exists but different options.
Common causes
- Calling createCollection on a collection that already exists
- Creating an index with a name that conflicts with an existing index
- Renaming a collection to a name that already exists
- Migration script running twice