Open Jolg42 opened 2 years ago
Not a bug we care about too much right now as Azure CosmosDB is not one of our officially supported databases.
Just shows again that The MongoDB API of CosmosDB is unfortunately not as compatible to MongoDB as they claim 😢
(Per docs $$REMOVE
should be available since 3.6: https://docs.microsoft.com/en-us/azure/cosmos-db/mongodb/feature-support-36)
Change that caused this: https://github.com/prisma/prisma-engines/pull/3088/files
Leads to queries like this:
prisma:query db.User.aggregate([ { $match: { $expr: { $and: [ { $and: [ { $eq: [ "$_id", ObjectId("6d795f757365725f69643030"), ], }, { $ne: [ "$_id", "$$REMOVE", ], }, ], }, ], }, }, }, { $project: { _id: 1, email: 1, name: 1, }, }, ])
Note We were running on a 4.0 CosmosDB database. Since we only support MongoDB 4.2+, see https://www.prisma.io/docs/reference/database-reference/supported-databases I upgraded the CosmosDB settings to 4.2 https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/upgrade-version But our CosmosDB test still fails with the same error https://github.com/prisma/ecosystem-tests/actions/runs/3335397850/jobs/5520029210
I created a support ticket on Azure
I got news from support
As per the update we got from our product team, the $$REMOVE variable is not supported in the $match stage of the aggregation pipeline. And also, they don't have any plans on implementing this feature in their immediate roadmap.
Note We were running on a 4.0 CosmosDB database. Since we only support MongoDB 4.2+, see https://www.prisma.io/docs/reference/database-reference/supported-databases I upgraded the CosmosDB settings to 4.2 https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/upgrade-version But our CosmosDB test still fails with the same error https://github.com/prisma/ecosystem-tests/actions/runs/3335397850/jobs/5520029210
I created a support ticket on Azure
same issue. they still haven't fixed it
Having this issue ATM, any update? Workaround? Thank you!
are there any workarounds for this issue?
No, unfortunately Azure CosmosDB for MongoDB does not support $$REMOVE
- but Prisma uses $$REMOVE
to run the queries it needs. As long as that is the state, there is no solution for this problem.
There are a lot of limitations with MongoDB on RU tier, which will probably never be supported by Prisma or another ORM, as it is not wire compatible with MongoDB API. The only thing you can try would be to use the vCore MongoDB tier, as that one is actual MongoDB under the hood and more comparable to Atlas. If you need serverless, you would be better off using the NoSQL API, as there is a real chance to get support by Prisma (#2713).
Bug description
Our ecosystem-test for mongodb-azure-cosmosdb is failing since 4.3.0-dev.81 https://github.com/prisma/ecosystem-tests/runs/8069434845?check_suite_focus=true#step:6:490
It seems likely from Flavian’s PR from
query-engine/connectors/mongodb-query-connector/src/filter.rs
https://github.com/prisma/prisma-engines/pull/3088/files#diff-36ea7d9312307ee40fa5e22d8299b057ec85c8fc46bcf523caa494026c2cdf33R1024-R1032How to reproduce
Test is here https://github.com/prisma/ecosystem-tests/tree/dev/databases/mongodb-azure-cosmosdb
Prisma information
Prisma Version
4.3.0-dev.81 and up 4.3.0