We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to migrate the large files from my MongoDB to S3 and found this script.
However, when I run it, I have issue with the following part.
function readFileFromMongo (file) { return gridFs.openDownloadStreamByName(file.filename) }
This openDownloadStreamByName (and also openDownloadStream), is returning the stream to me in the following format:
openDownloadStreamByName
openDownloadStream
GridFSBucketReadStream { s: { bytesRead: 0, chunks: { s: {...} }, cursor: null, expected: 0, files: { s: {...} }, filter: { filename: "test_file.pdf", }, init: false, expectedEnd: 0, file: null, options: { sort: { uploadDate: -1, }, skip: null, start: undefined, end: undefined, }, readPreference: undefined, }, _readableState: { objectMode: false, highWaterMark: 16384, buffer: { head: null, tail: null, length: 0, }, length: 0, pipes: [ ], flowing: null, ended: false, endEmitted: false, reading: false, constructed: true, sync: true, needReadable: false, emittedReadable: false, readableListening: false, resumeScheduled: false, errorEmitted: false, emitClose: true, autoDestroy: true, destroyed: false, errored: null, closed: false, closeEmitted: false, defaultEncoding: "utf8", awaitDrainWriters: null, multiAwaitDrain: false, readingMore: false, dataEmitted: false, decoder: null, encoding: null, }, _events: { }, _eventsCount: 0, _maxListeners: undefined, }
{ s: { bytesRead: 0, chunks: { s: {...} }, cursor: null, expected: 0, files: { s: {...} }, filter: { filename: "test_file.pdf", }, init: false, expectedEnd: 0, file: null, options: { sort: { uploadDate: -1, }, skip: null, start: undefined, end: undefined, }, readPreference: undefined, }, _readableState: { objectMode: false, highWaterMark: 16384, buffer: { head: null, tail: null, length: 0, }, length: 0, pipes: [ ], flowing: null, ended: false, endEmitted: false, reading: false, constructed: true, sync: true, needReadable: false, emittedReadable: false, readableListening: false, resumeScheduled: false, errorEmitted: false, emitClose: true, autoDestroy: true, destroyed: false, errored: null, closed: false, closeEmitted: false, defaultEncoding: "utf8", awaitDrainWriters: null, multiAwaitDrain: false, readingMore: false, dataEmitted: false, decoder: null, encoding: null, }, _events: { }, _eventsCount: 0, _maxListeners: undefined, }
When I try to upload this file with s3.upload function, I get nothing, like it's not calling.
s3.upload
This are the params I'm passing to the upload function: { ACL: "public-read", Bucket: "migration-mongodb-documents-storage", Key: "test_file.pdf", Body: { s: { bytesRead: 0, chunks: { s: {...} }, cursor: null, expected: 0, files: { s: {...} }, filter: { filename: "test_file.pdf", }, init: false, expectedEnd: 0, file: null, options: { sort: { uploadDate: -1, }, skip: null, start: undefined, end: undefined, }, readPreference: undefined, }, _readableState: { objectMode: false, highWaterMark: 16384, buffer: { head: null, tail: null, length: 0, }, length: 0, pipes: [ ], flowing: null, ended: false, endEmitted: false, reading: false, constructed: true, sync: true, needReadable: false, emittedReadable: false, readableListening: false, resumeScheduled: false, errorEmitted: false, emitClose: true, autoDestroy: true, destroyed: false, errored: null, closed: false, closeEmitted: false, defaultEncoding: "utf8", awaitDrainWriters: null, multiAwaitDrain: false, readingMore: false, dataEmitted: false, decoder: null, encoding: null, }, _events: { }, _eventsCount: 0, _maxListeners: undefined, }, ContentType: "binary/octet-stream", }
{ ACL: "public-read", Bucket: "migration-mongodb-documents-storage", Key: "test_file.pdf", Body: { s: { bytesRead: 0, chunks: { s: {...} }, cursor: null, expected: 0, files: { s: {...} }, filter: { filename: "test_file.pdf", }, init: false, expectedEnd: 0, file: null, options: { sort: { uploadDate: -1, }, skip: null, start: undefined, end: undefined, }, readPreference: undefined, }, _readableState: { objectMode: false, highWaterMark: 16384, buffer: { head: null, tail: null, length: 0, }, length: 0, pipes: [ ], flowing: null, ended: false, endEmitted: false, reading: false, constructed: true, sync: true, needReadable: false, emittedReadable: false, readableListening: false, resumeScheduled: false, errorEmitted: false, emitClose: true, autoDestroy: true, destroyed: false, errored: null, closed: false, closeEmitted: false, defaultEncoding: "utf8", awaitDrainWriters: null, multiAwaitDrain: false, readingMore: false, dataEmitted: false, decoder: null, encoding: null, }, _events: { }, _eventsCount: 0, _maxListeners: undefined, }, ContentType: "binary/octet-stream", }
Am I doing something wrong?
The text was updated successfully, but these errors were encountered:
What happens when you run the script? Would you mind to share the output?
Sorry, something went wrong.
No branches or pull requests
I'm trying to migrate the large files from my MongoDB to S3 and found this script.
However, when I run it, I have issue with the following part.
function readFileFromMongo (file) { return gridFs.openDownloadStreamByName(file.filename) }
This
openDownloadStreamByName
(and alsoopenDownloadStream
), is returning the stream to me in the following format:GridFSBucketReadStream
{ s: { bytesRead: 0, chunks: { s: {...} }, cursor: null, expected: 0, files: { s: {...} }, filter: { filename: "test_file.pdf", }, init: false, expectedEnd: 0, file: null, options: { sort: { uploadDate: -1, }, skip: null, start: undefined, end: undefined, }, readPreference: undefined, }, _readableState: { objectMode: false, highWaterMark: 16384, buffer: { head: null, tail: null, length: 0, }, length: 0, pipes: [ ], flowing: null, ended: false, endEmitted: false, reading: false, constructed: true, sync: true, needReadable: false, emittedReadable: false, readableListening: false, resumeScheduled: false, errorEmitted: false, emitClose: true, autoDestroy: true, destroyed: false, errored: null, closed: false, closeEmitted: false, defaultEncoding: "utf8", awaitDrainWriters: null, multiAwaitDrain: false, readingMore: false, dataEmitted: false, decoder: null, encoding: null, }, _events: { }, _eventsCount: 0, _maxListeners: undefined, }
When I try to upload this file with
s3.upload
function, I get nothing, like it's not calling.This are the params I'm passing to the upload function:
{ ACL: "public-read", Bucket: "migration-mongodb-documents-storage", Key: "test_file.pdf", Body: { s: { bytesRead: 0, chunks: { s: {...} }, cursor: null, expected: 0, files: { s: {...} }, filter: { filename: "test_file.pdf", }, init: false, expectedEnd: 0, file: null, options: { sort: { uploadDate: -1, }, skip: null, start: undefined, end: undefined, }, readPreference: undefined, }, _readableState: { objectMode: false, highWaterMark: 16384, buffer: { head: null, tail: null, length: 0, }, length: 0, pipes: [ ], flowing: null, ended: false, endEmitted: false, reading: false, constructed: true, sync: true, needReadable: false, emittedReadable: false, readableListening: false, resumeScheduled: false, errorEmitted: false, emitClose: true, autoDestroy: true, destroyed: false, errored: null, closed: false, closeEmitted: false, defaultEncoding: "utf8", awaitDrainWriters: null, multiAwaitDrain: false, readingMore: false, dataEmitted: false, decoder: null, encoding: null, }, _events: { }, _eventsCount: 0, _maxListeners: undefined, }, ContentType: "binary/octet-stream", }
Am I doing something wrong?
The text was updated successfully, but these errors were encountered: