Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-1548

Access filename and metadata in gridfs DownloadStream

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.4.0
    • Affects Version/s: None
    • Component/s: GridFS
    • Labels:
      None
    • Fully Compatible

      The api for gridfs does not give you access to the filename or metadata of a file when downloading it even though internally it fetches the file document. I propose adding fields or methods to access these on `DownloadStream` and internally just linking up to the file document which is already fetched. This would prevent user libraries from having to implement this and also from having to redundantly lookup the file document(ie read from the db again).

      Our app uses file ids to lookup files but we use the name and metadata(contenttype stored here) to provide a more friendly url to the user. While upgrading from globalsign/mgo I found that the gridfs implementation here doesn't give you any way to read file names or metadata easily. Right now you have to hack around it by fetching the file again and decoding it yourself.

            Assignee:
            divjot.arora@mongodb.com Divjot Arora (Inactive)
            Reporter:
            epelc@greatcloak.com Ed Pelc
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: