Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-1087

Problems reading small file with GridFSBucket API

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: GridFS
    • Environment:
      Running on Linux 64bit KDE neon User Edition 5.9 (Ubuntu Xenial Based)
      npm-mongo@2.2.24
    • Not Needed
    • Not Needed

      Using the code below is working fine with files having a size greater than the chunksize, however trying to read a 30056 Bytes file with a bucket defined with a default chunksize of 261120 Bytes, it takes a long time (about a whole minute) before returning the content, where bigger files are returned instantly.

      const mongo = Package.mongo.MongoInternals.NpmModule;
      const db = Package.mongo.MongoInternals.defaultRemoteCollectionDriver().mongo.db;
      const mongoStore = new mongo.GridFSBucket(db, {
        bucketName: "fs",
        chunkSizeBytes: 1024 * 255
      });
      const readStream = mongoStore.openDownloadStream("123456", {
        start: 0,
        end: 30055
      });
      return writeStream;
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            jalik Karl Stein
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: