Skip to content

Commit e44227e

Browse files
authored
feat: updated coming-from-mongock to add new MongockSupport annotation fields (#116)
1 parent f42a701 commit e44227e

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

docs/resources/coming-from-mongock.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ sidebar_position: 999
44
---
55
import Tabs from '@theme/Tabs';
66
import TabItem from '@theme/TabItem';
7+
import VersionBadge from '@site/src/components/VersionBadge';
78

89
# Coming from Mongock
910

@@ -105,6 +106,38 @@ A full explanation of why this is required (and how Mongock’s model differs fr
105106

106107
**That’s all you need to activate Mongock support.** From there, Flamingock handles the detection of legacy changes, audit import, and stage ordering automatically.
107108

109+
### Optional configuration <VersionBadge version="1.1.0" />
110+
111+
The `@MongockSupport` annotation includes optional fields you can use to configure how Flamingock reads Mongock’s audit log. Both fields accept **literal values** or **property placeholders**.
112+
113+
| Name | Type | Default | Description |
114+
| --- | --- | --- | --- |
115+
| `origin` | `String` | "" | The Mongock audit origin to read from. Supports literal values and placeholders. When empty (default), Flamingock uses Mongock’s default origin value. |
116+
| `emptyOriginAllowed` | `String` | "" | Whether Flamingock should allow an empty origin during import. Supports literal values and placeholders. Allowed values are `true`, `false`, or empty. When empty (default), it is treated as `false`, and Flamingock will fail if the origin is empty. |
117+
118+
:::info
119+
`origin` value by Mongock driver:
120+
121+
- **MongoDB**: collection name.
122+
- **DynamoDB**: table name.
123+
- **Couchbase**: either the collection name (implicit `_default` scope) or `{scope}.{collection}` (for example, `"myscope.mycollection"`).
124+
:::
125+
126+
Example:
127+
128+
```java
129+
@MongockSupport(
130+
targetSystem = "mongodb-target-system",
131+
origin = "customChangeLog",
132+
emptyOriginAllowed = "true"
133+
)
134+
public class Application { }
135+
```
136+
137+
:::tip Property placeholders
138+
Configuration values can be set by referencing properties in the Flamingock context using the format `${my.custom.property:defaultValue}`.
139+
:::
140+
108141
## Understanding the target system for Mongock migrations
109142

110143
Mongock and Flamingock follow different models when interacting with external systems, so it is important to understand how the `targetSystem` defined in `@MongockSupport` fits into a Flamingock application.

0 commit comments

Comments
 (0)