Cursor.clone does not return legacy version of cursor

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor - P4
    • legacy-5.0.0
    • Affects Version/s: legacy-4.0.0, legacy-4.0.1
    • Component/s: None
    • 2
    • Not Needed
    • None
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      What problem are you facing?

      FindCursor.clone/AggCursor.clone do not return legacy versions so callback style usage after a clone stops working as the instance is a promise only version.

      What driver and relevant dependency versions are you using?

      mongodb-legacy package

      Steps to reproduce?

      The second toArray never invokes the callback

      const cursor = coll.find({});
            this.defer(() => cursor.close());
      
            cursor.toArray((err, docs) => {
              expect(err).to.not.exist;
              expect(docs).to.have.length(6);
              expect(cursor).property('closed').to.be.true;
      
              const clonedCursor = cursor.clone();
              this.defer(() => clonedCursor.close());
      
              clonedCursor.toArray((err, docs) => {
                expect(err).to.not.exist;
                expect(docs).to.have.length(6);
                expect(clonedCursor).property('closed').to.be.true;
                done();
              });
            });
      

              Assignee:
              Neal Beeken
              Reporter:
              Neal Beeken
              Durran Jordan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: