Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-2961

Improve error message for insertMany

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 4.0.0
    • Affects Version/s: 4.0.0
    • Component/s: Shell
    • None

      According to the CRUD spec, insertMany throws when it is called with an empty array.

      The error thrown by the driver is a TypeError with message Invalid Operation, no operations specified.

      That might confuse users. I wonder if it should be spelled out that this error means that "there are no operations specified in the batch" or that "batch cannot be empty".

      We were looking at this from the perspective of a shell user who sees this error perhaps generated during the execution of a script but I think making the message clearer could be beneficial for most users.

            Assignee:
            neal.beeken@mongodb.com Neal Beeken
            Reporter:
            massimiliano.marcon@mongodb.com Massimiliano Marcon
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: