method Cursor.clone() returns a new Cursor instance with references on parent

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • 2.4
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      method clone() returns a new Cursor instance with references on parent Cursor.

      simple example

      c=db.list.find({})
      print c.Cursor_spec
      c2=c.clone()
      c2.Cursor_spec['_id']=1
      print c.Cursor_spec
      print c2.Cursor_spec

      I get output
      {}

      {'_id': 1} {'_id': 1}

      probably better to do a copy all arguments so that can change the clone without consequences.

              Assignee:
              Ross Lawley
              Reporter:
              Denis
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: