find_and_modify + field returns nothing but _id

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.0
    • Affects Version/s: 1.11
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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 Hackett
              Reporter:
              Jonas H
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: