-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: 3.6.4
-
Component/s: None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Pipelining an upload stream you've created with GridFSBucket.
openUploadStream worked on Node v12.20.1 and v10.23.0, but it never finishes on Node v14.16.0.
async function test() {
const mongoClient = await mongodb.MongoClient.connect('mongodb://localhost', {
useUnifiedTopology: true
});
const mongoDb = mongoClient.db('test');
const bucket = new mongodb.GridFSBucket(mongoDb, {
bucketName: 'testBucket'
});
const fileStream = fs.createReadStream('test.js');
const uploadStream = bucket.openUploadStream('test');
await util.promisify(stream.pipeline)(fileStream, uploadStream);
}
You can find the whole test at https://github.com/snakamura/mongodb-fsbucket-pipeline.