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

Return raw file document from GridFS\Bucket::uploadFromStream

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

      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.

            Assignee:
            andreas.braun@mongodb.com Andreas Braun
            Reporter:
            frederick888@tsundere.moe Frederick Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: