duyluonglc / lucid-mongo

Mongodb ODM for adonis framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CosmosDB (Mongo) - does not contain shard key for pattern

lcnvdl opened this issue · comments

commented

Hi! I'm having problems using Lucid Mongo with Cosmos DB. The message is "does not contain shard key for pattern". It happens when I'm trying to find a document in a collection, without adding the "shard key" in the find method.

In Mongoose there's a solution: defining the shard keys in the schema:

new Schema({ .. }, { shardKey: { tag: 1, name: 1 }})

How can I do this using lucid mongo?

any news on this?

commented

any news on this?

We had a lot of problems with Shard keys (wich are required for CosmosDB) and Lucid, so we've decided to stop using CosmosDB, and now we are using MongoDB Cloud. We don't have problems with this cloud service.