liquibase-mongodb icon indicating copy to clipboard operation
liquibase-mongodb copied to clipboard

runCommand fails to run customAction

Open Yuriy-Lukashevich opened this issue 3 years ago • 0 comments

I’m trying to add liquibase to my project. I need to create a collection along with index and shard keys creation:

db.runCommand({customAction: “CreateCollection”, collection: “name”, offerThroughput: 400, shardKey: “partition_key”, indexes: [{key: {_id: 1}}, {key: {partition_key: 1, some_key: 1},unique: true}]});

offerThroughput key is specific for CosmosDB which I’m using in my project.

I tried next options:

{customAction: "CreateCollection", collection: "name", offerThroughput: 400, shardKey: "partition_key", indexes: [{key: {_id: 1}, name: "_id_1"}, {key: {partition_key: 1, some_key: 1}, name: "partition_key_1_some_key_1", unique: true}]} All my attempts failed. I didn't find any example with such a command so, I would appreciate it very much if somebody could share the syntax to run such a command on MongoDB.

┆Issue is synchronized with this Jira Bug by Unito

Yuriy-Lukashevich avatar Jul 15 '21 22:07 Yuriy-Lukashevich