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

AttributeError: 'RawBSONDocument' object has no attribute 'copy'

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.3
    • None
    • None

    Description

      >>> from bson.raw_bson import RawBSONDocument
      >>> from bson.codec_options import CodecOptions
      >>> import pymongo
      >>> client = pymongo.MongoClient()
      >>> opts = CodecOptions(document_class=RawBSONDocument)
      >>> collection = client.get_database('test', codec_options=opts).collection
      >>> collection.update_one({'_id': 1}, {'$set': {'x': 1}})
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
        File "/Users/emptysquare/.virtualenvs/c-driver/lib/python2.7/site-packages/pymongo/collection.py", line 835, in update_one
          bypass_doc_val=bypass_document_validation)
        File "/Users/emptysquare/.virtualenvs/c-driver/lib/python2.7/site-packages/pymongo/collection.py", line 709, in _update
          codec_options=self.codec_options).copy()
      AttributeError: 'RawBSONDocument' object has no attribute 'copy'
      

      Attachments

        Activity

          People

            luke.lovett Luke Lovett
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: