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

find_and_modify + field returns nothing but _id

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.0
    • Affects Version/s: 1.11
    • Component/s: None
    • Labels:
      None

      >>> test = pymongo.Connection().test.test
      >>> test.insert(

      {'a': 1}

      )
      ObjectId('4e0509dce4721c2217000000')

      >>> test.find_and_modify({}, {'$inc': {'a': 1}})

      {u'a': 1, u'_id': ObjectId('4e0509dce4721c2217000000')}

      >>> test.find_and_modify({}, {'$inc': {'a': 1}}, fields=['a'])

      {u'_id': ObjectId('4e0509dce4721c2217000000')}

      As soon as you pass a `fields` option only the _id field is returned.

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            jonash Jonas H
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: