Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-5728

Requested id is not honored when uploading file to GridFS with session using Scala driver

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Unknown Unknown
    • 5.3.2
    • Affects Version/s: 5.1.0
    • Component/s: Reactive Streams, Scala
    • None
    • None
    • Java Drivers
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Summary

      When uploading a file with gridFSBucket.uploadFromObservable, a blob id you want to insert data with is not honored when using a session.

      That said, the following works (record in files created with bsonBlobId provided:
      gridFSBucket.uploadFromObservable(bsonBlobId, fileName.getOrElse(""), observableToUploadFrom, options).headResult()

      this doesn't work in terms data still uploaded, files & chunks populated but not with bsonBlobId : gridFSBucket.uploadFromObservable(session, bsonBlobId, fileName.getOrElse(""), observableToUploadFrom, options).headResult()

      Scala 2.13.14 / Scala driver 5.1.0 & 5.2.0, Single node replica set 6.0

      I adapted MongoDb Scala example how to upload file to GridFS. Just modified to accept 'blobId' & for the 2nd case 'blobId' & 'session', see attached.
      Thanks for looking into it.

            Assignee:
            maxim.katcharov@mongodb.com Maxim Katcharov
            Reporter:
            sergeh07@gmail.com sergeh07 N/A
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              None
              None
              None
              None