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

Cannot set option on cursor, even if open

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Minor - P4 Minor - P4
    • No version
    • Affects Version/s: None
    • Component/s: Services Providers
    • None
    • Iteration Jackfruit
    • Not Needed

      Seems the node driver throws a "MongoError: Cursor is closed" if you try to change an option, even if the cursor isClosed is false.

      > const c = db.coll.find()

      > c.isClosed()
      false
      > c.addOption(64)
      Thrown:
      MongoError: Cursor is closed

      Note that using the internal cursor does the same thing, so it may be either a driver issue or a bug with how we expect the driver to act.

      > c.cursor.addCursorFlag(16)
      Thrown:
      MongoError: Cursor is closed
      > c.cursor.isClosed()
      false

       

            Assignee:
            anna.herlihy@mongodb.com Anna Herlihy (Inactive)
            Reporter:
            anna.herlihy@mongodb.com Anna Herlihy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: