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

Improve error message for insertMany

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 4.0.0
    • Fix Version/s: 4.0.0
    • Component/s: Shell
    • Labels:

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: