I'm trying a brand new prisma + Azure Cosmos DB (w...
# mongodb
l
I'm trying a brand new prisma + Azure Cosmos DB (with Mongo API) installation but, apparently, something broke in one of the last updates. I apologize if this was discussed before, but I had tested prisma 2 with Mongo Preview with Cosmos DB and it worked amazingly well. Perhaps it was the usage of multi-document transactions? When I try to run an upsert, I get this error:
Copy code
✗ npx ts-node prisma/seed.ts
PrismaClientUnknownRequestError: 
Invalid `prisma.user.upsert()` invocation:


  Error occurred during query execution:
ConnectorError(ConnectorError { user_facing_error: None, kind: RawError { code: "unknown", message: "Command failed (OperationNotSupportedInTransaction): Command insert failed : can not create collection in a multi-document transaction)" } })
    at cb (/Users/luisrudge/code/cinereview/node_modules/@prisma/client/runtime/index.js:38687:17)
    at async main (/Users/luisrudge/code/cinereview/prisma/seed.ts:5:16) {
  clientVersion: '3.6.0'
}
n
Hi Luis! I ran into the same issue this morning. What did the trick for me was running
npx prisma db push
before running my script, which created the collections in my brand new db, therefore allowing mongo transactions to be executed without the cannot create collection issue. 🙂 Hopefully this will help! Cheers