Last active
July 31, 2017 15:31
-
-
Save bszwej/26e2c996d7e179ab871e74fd916ea039 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Source.fromPublisher(collection.find(): Publisher[org.bson.Document]) | |
.map((doc: org.bson.Document) ⇒ doc.toJson()) | |
.map((json: String) ⇒ ByteString(json)) | |
.runWith(s3Sink) | |
val s3Sink: Sink[ByteString, Future[MultipartUploadResult]] = | |
s3Client.multipartUpload( | |
bucket = "bucketWithCookies", | |
key = "CookieCollectionBackup.json" | |
) | |
The full runnable code can be found here: | |
https://github.com/bszwej/mongodb-s3-stream-example |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment