0

I'd ideally like to specify my changelog in JSON format, similar to Liquibase's JSON option, as follows below. Notably, I'd also like to do a substitution for the Integer value of clusterId at runtime as well, and wonder if property substitution is also supported in Mongock's JSON changelog format.

{
  "databaseChangeLog": [
    {
      "changeSet": {
        "id": "1",
        "author": "admin",
        "comment": "Populate ISSUES collection",
        "changes": [
          {
            "insertMany": {
              "collectionName": "ISSUES",
              "documents": {
                "$rawJson": [
                  {
                    "CLUSTER_ID": ${clusterId},
                    "LABEL": "defaultTag",
                    "ORDER": 1
                  },
                  {
                    "CLUSTER_ID": ${clusterId},
                    "LABEL": "defaultIssue",
                    "ORDER": 2
                  }
                ]
              }
            }
          }
        ]
      }
    }
  ]
}

Looking at Mongock's documentation and examples, I could only find changelogs written in the annotated Java class format. For internal maintainability, my project has a strong preference for writing changelogs in JSON format and I'm wondering if this is something that Mongock supports.

foj
  • 7
  • 2
  • Mongock currently doesn't provide support for JSON format. It's based on a programatic approach that it's aligned with its vision, providing multiple benefits. – Mongock team Jul 21 '23 at 07:36
  • However, the Mongock team is working in the next version, which will bring templates and will be a game changer, allowing, among other things, JSON format. – Mongock team Jul 21 '23 at 07:36

0 Answers0