Open Bashayam opened 3 years ago
This seems still not to work. I'm trying to create a view instead of a collection and provide the corresponding options. It seems to work in JSON and XML but doesn't work in YAML e.g.:
databaseChangeLog:
- changeSet:
id: 1
author: alevik
comment: drop leads view if exists
runAlways: true
failOnError: true
changes:
- dropCollection:
collectionName: leads
- changeSet:
id: 2
author: devopsbilling@cloud.ionos.com
comment: create leads view
runAlways: true
failOnError: true
changes:
- createCollection:
collectionName: leads
options:
- $rawjson:
- viewOn: leadevents
The changeset above works, however, the options are being ignored which could be seen in the debug messages of liquibase:
[2022-09-01 12:01:22] FINE [liquibase.util] Computed checksum for createCollection:[
collectionName="leads"
] as e586c47353eda5910766997768da6600
Collection is being created as a regular collection, not a view since the corresponding options are being ignored (in the real example I also provide the pipeline for the view creation but omitted it here for brevity)
I am working on liquibase for mongodb, and tried using YAML format as a changeset for my database. (This is because YAML is the preferred format used across other services in the project)
This is the sample changeset:
With the above YAML changeset what happened was, the parsing was successful until the createCollection. So, the collection was created successfully, but the validation rules were not applied, since the YAML wasn't able to parse $rawJson.
Is there a way that this can be achieved? (The parsing should work successfully and the validator must be updated with the rules specified in YAML).
PS:
in addition to the liquibase maven extension jar and mongo java driver jar.
┆Issue is synchronized with this Jira Bug by Unito