Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-3141

Investigate changes in SERVER-64416: Have view creation return the same error as collection creation

    • Type: Icon: Investigation Investigation
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Not Needed

      Original Downstream Change Summary

      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"
      }
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: