Sink plugin : MongoDB [Spark]
Write data to MongoDB
name | type | required | default value |
---|---|---|---|
writeconfig.uri | string | yes | - |
writeconfig.database | string | yes | - |
writeconfig.collection | string | yes | - |
writeconfig.* | string | no | - |
uri to write to mongoDB
database to write to mongoDB
collection to write to mongoDB
More other parameters can be configured here, see MongoDB Configuration for details, see the Output Configuration section. The way to specify parameters is to add a prefix to the original parameter name writeconfig.
For example, the way to set localThreshold
is writeconfig.localThreshold=20
. If you do not specify these optional parameters, the default values of the official MongoDB documentation will be used.
mongodb {
writeconfig.uri = "mongodb://username:password@127.0.0.1:27017/test_db"
writeconfig.database = "test_db"
writeconfig.collection = "test_collection"
}