Not able to create indexes using json format on mongodb and unable to generate change logs on existing mongodb databases to capture the changes

Not able to create indexes using json format on mongodb and unable to generate change logs on existing mongodb databases to capture the changes

{
    "databaseChangeLog": [{
            "property": {
                "name": "collection.name",
                "value": "person3"
            }
        },
        {
            "changeSet": {
                "id": "12334d",
                "author": "murali",
                "changes": [{
                    "createIndex": {
                        "collectionName": "${collection.name}",
                        "indexQuery": { "clientId": 1,"type": 1 },
                        "indexOptions": {
                            "$rawJson": {
                                "unique": true,
                                "name": "new_index_key"
                            }
                        }
                    }
                }]
            }
        }
    ]
}


	... 67 more
Caused by: com.mongodb.MongoCommandException: Command failed with error 67 (CannotCreateIndex): 'Error in specification { key: {} } :: caused by :: Index keys cannot be empty.' on server localhost:27017. The full response is {"ok": 0.0, "errmsg": "Error in specification { key: {} } :: caused by :: Index keys cannot be empty.", "code": 67, "codeName": "CannotCreateIndex"}
	at com.mongodb.internal.connection.ProtocolHelper.getCommandFailureException(ProtocolHelper.java:195)
	at com.mongodb.internal.connection.InternalStreamConnection.receiveCommandMessageResponse(InternalStreamConnection.java:400)
	at com.mongodb.internal.connection.InternalStreamConnection.sendAndReceive(InternalStreamConnection.java:324)

Hi @kmkrishna1223 - Welcome to the Liquibase Community!

I found an issue with a similar error that was related to the size that the index is or might become over time. This one has a lot of discussion on StackOverflow with a couple of suggested answers and comments with helpful information. Have you seen this one already? indexing - Mongodb - Multiple text index: Index key pattern too large error code 67 - Stack Overflow

-Tabby

Thanks for the response.
I am not using text indexes and its working with XML change log .

Even tried with different approaches with json its failed to form keys as follows

[2022-10-27 03:39:24] FINE [liquibase.ext] Executing Statement: db.runCommand({"createIndexes": "person3", "indexes": [{**"key": {}}]}**);