【发布时间】:2022-01-22 18:17:16
【问题描述】:
我很高兴最近了解了Prisma,并迅速在我的最新项目中替换了 mongoose。
通过使用连接字符串,集成很容易,并且与 CosmosDB 的连接工作正常。
我的问题:似乎我无法更新任何数据,因为 CosmosDB 正在抛出原始错误:
Invalid `prisma.addresses.update()` invocation:
Error occurred during query execution:
ConnectorError(ConnectorError { user_facing_error: None, kind: RawError { code: "unknown", message: "Command failed (BadValue): Expected type object but found array.)" } })
我正在运行 Azure (4.0) 上可用的最新 MongoDB 服务器版本,并且更新非常基础:
await this.prisma.addresses.update({
where: {
id: 'something',
},
data: {
city: 'Something'
}
})
查询和创建文档没有造成任何问题。
【问题讨论】:
-
你能分享你的架构吗?
标签: node.js azure azure-cosmosdb prisma