Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-399

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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.4
    • Affects Version/s: None
    • Component/s: 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@mongodb.com Ross Lawley
            Reporter:
            uchti Denis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: