-
Type: Investigation
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Not Needed
View creation now returns NamespaceExists instead of code 17399 when there is a namespace conflict.
Description of Linked Ticket
Currently creating a view would returns an error code 17399 instead of `NamespaceExists` error in case of namespace collision. Since view creation and collection creation use the same API, returning different errors would be confusing to users and they could easily miss catching this error in their code. so we should have view creation return the same error as collection creation to make them consistent. This ticket can also investigate if we return inconsistent errors in other cases in addition to namespace collision.
> db.runCommand({create: "bar", viewOn: "aaa", pipeline: []}) { "ok" : 0, "errmsg" : "Cannot create collection test.bar - collection already exists.", "code" : 17399, "codeName" : "Location17399" }
- depends on
-
SERVER-64416 Have view creation return the same error as collection creation
- Closed