Uploaded image for project: 'PHP Driver: Library'
  1. PHP Driver: Library
  2. PHPLIB-486

Return raw file document from GridFS\Bucket::uploadFromStream

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: 1.5.0
    • Fix Version/s: None
    • Labels:
      None

      Description

      I'm using mongodb-odm and currently the framework needs to run additional queries after file uploads to retrieve up-to-date file documents. But this appears to be redundant to me as \MongoDB\GridFS\Bucket::uploadFromStream returns \MongoDB\GridFS\Bucket::getFileIdForStream which already pulls the same data via \MongoDB\GridFS\Bucket::getRawFileDocumentForStream.

      So I think it'd be nice if the result of \MongoDB\GridFS\Bucket::getRawFileDocumentForStream can be returned to the caller. This can be done by changing the return value of \MongoDB\GridFS\Bucket::uploadFromStream (breaking change) or a new passed-by-reference parameter. Both should be easy fixes and I can write up a PR if you like the idea.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: