Install
cargo install faucet-cli --features sink-mongodb faucet init --sink mongodb
# Cargo.toml — use it as a library cargo add faucet-sink-mongodb
Starter config
sink:
type: mongodb
config:
connection_uri: "" # REQUIRED — MongoDB connection URI (e.g.
database: "" # REQUIRED — Database name.
collection: "" # REQUIRED — Collection name.
# batch_size: 1000 # Maximum number of documents per `insert_many` call.
# ordered: false # Whether `insert_many` is **ordered**.
# write_mode: null # Write semantics for a sink.
# key: [] # Key columns.
# delete_marker: null # Optional.
# rollback: null # Runtime rollback settings (#706): the run id to journal under, the run-id column, and whether to journal before-images / keep a replaced table.
Capabilities
| Delivery | Exactly-once (atomic watermark) |
|---|---|
| Write modes | append, upsert, delete, overwrite |
| Exactly-once writes | Yes |
| Schema evolution | No |
| Scoped cleanup | Yes |
| Staged bulk load | No |
| Run rollback | No |
| Compression | No |
Config fields
| Field | Type | Default | Description |
|---|---|---|---|
connection_urirequired | string | — | MongoDB connection URI (e.g. mongodb://localhost:27017). |
databaserequired | string | — | Database name. |
collectionrequired | string | — | Collection name. |
batch_size | integer | 1000 | Maximum number of documents per insert_many call. Defaults to DEFAULT_BATCH_SIZE (1000), which is a good balance for MongoDB's per-request limits and round-trip cost. |
ordered | boolean | false | Whether insert_many is **ordered**. Default false (unordered). |
write_mode | object | append | Append (default), upsert, or delete. |
key | array | [] | Key columns. Required and non-empty for upsert/delete; ignored for append. |
delete_marker | object | — | Optional. Upsert only: rows whose field matches one of values are deletes; all others are upserts. The marker field is stripped from upsert rows before writing. |
rollback | object | — | Runtime rollback settings (#706): the run id to journal under, the run-id column, and whether to journal before-images / keep a replaced table. Injected per invocation by the CLI when a config has a top-level rollback: block — not meant to be written by hand. |
Get started
Your first pipeline runs in five minutes.
Install the CLI, scaffold a config, and move real data — nothing external to stand up.
curl -LsSf https://github.com/faucet-hq/faucet-stream/releases/latest/download/faucet-cli-installer.sh | sh brew install faucet-hq/faucet-stream/faucet-cli