Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-2002

Throw for EJSON.serialize(cursor)

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.4.0
    • Affects Version/s: None
    • Component/s: Shell API
    • None
    • 2
    • Iteration Venus
    • Not Needed
    • Developer Tools

      In conjunction with NODE-6708, we could use the toJSON() method to throw a better exception when a user attempts to serialize a cursor with JSON.stringify(), EJSON.stringify() and friends, pointing them at the fact that they likely want to call .toArray() first.

      We can do this independently of NODE-6708 and only test it with JSON.stringify() until that ticket has been addressed.

            Assignee:
            alena.khineika@mongodb.com Alena Khineika
            Reporter:
            anna.henningsen@mongodb.com Anna Henningsen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: