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

GridFS file metadata not always stored on server

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

      Setting an attribute on an open GridIn object doesn't update the document on the server unless it is named "filename" or "content_type". Other attributes appear to be settable on open GridIn objects but aren't sent to the server when the GridIn is closed.

      db = Connection().test
      gin1 = GridIn(db.fs, _id=1)
      gin1.quux = 'fizzle'
      gin1.close()
      
      gin2 = GridIn(db.fs, _id=2)
      gin2.close()
      gin2.quux = 'fizzle'
      
      
      list(db.fs.files.find({'_id': {'$in': [1, 2]}}, {'quux': True}))
      

      Expected:

      [{u'_id': 1, u'quux': u'fizzle'}, {u'_id': 2, u'quux': u'fizzle'}]
      

      Actual:

      [{u'_id': 1}, {u'_id': 2, u'quux': u'fizzle'}]
      

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: