mongo-to-sqs
Send a large number of MongoDB documents to an AWS SQS queue.
- Populates SQS with documents from MongoDB
- Uses back-pressure to prevent buffering documents in memory
- Works with very large collections
Install
npm i mongo-to-sqs
Usage
const MongoToSqs = ; const loader = cursor // db.collection.find() sqs // new AWS.SQS() queueUrl // the url of the SQS queue formatPayload // sync function to transform the document into the SQS MessageBody concurrency // number of concurrent SQS requests (default: 2500); loaderstart;
Example
const MongoDB = ;const AWS = ;const MongoToSqs = ; MongoDBMongoClient;
License
MIT