Skip to main content
The MongoDB Sink command (Command Type: 1204) sends the job result to the sink service, which writes it to a MongoDB collection.

Command Type

Command Type ID: 1204

Parameters

ParameterTypeDescriptionRequired
collectionstringThe MongoDB collection where documents will be writtenYes
dataSegmentToSendstringWhich part of the data to send. Possible values: "fullData", "data". Defaults to "data"Yes
operationstringWhether to always insert a new document or replace a matched documentYes

Usage Examples

Insert into MongoDB

{
  "command": "mongodb-sink",
  "params": {
    "collection": "events",
    "dataSegmentToSend": "data",
    "operation": "insert"
  }
}

Upsert (Replace) by Match Key

{
  "command": "mongodb-sink",
  "params": {
    "collection": "live_odds",
    "dataSegmentToSend": "data",
    "operation": "upsert"
  }
}