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

GridFS file metadata not always stored on server

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4
    • Component/s: None
    • Labels:
      None

      Description

      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'}]

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: