-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.2.33
-
Component/s: Lambda
-
Environment:AWS-Lambda for desired Runtime
Problem can be reproduced locally with MAC-OSX running Node 6.10.3
-
Empty show more show less
When working on a lambda for our team that dumps a MongoDB cursor's contents into an s3 bucket, we opted to use AWS-SDK ManagedUpload due to its ability to perform uploads from streams,buffers etc while specifying a part size in order to limit memory consumption.
Unfortunately, I have not been able to get it to work with MongoDB cursor's stream. I have confirmed that the reading loop performed by ManagedUpload's send method will work for a normal stream, but not for Mongo's. I have attached a js file exporting a function that takes in a cursor, and runs a re-implimented version of ManagedUpload's read loop. I have pasted their code commented at the bottom of the file for reference. It seems to be a valid read-loop, and can empty out the normal readable just fine.
Please let me know if you have any questions or issues reproducing this issue. Thanks