Details
-
Bug
-
Resolution: Won't Fix
-
Major - P3
-
None
-
None
-
Running on Linux 64bit KDE neon User Edition 5.9 (Ubuntu Xenial Based)
npm-mongo@2.2.24
Description
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;
|