开发者社区 问答 正文

请问mongodb支持这种更新方式吗?

请问mongodb支持这种更新方式吗?db.students3.updateMany( { }, { $inc: { "grades.$[elem].std" : -1 } }, { arrayFilters: [ { "elem.grade": { $gte: 80 }, "elem.std": { $gt: 5 } } ] } ) 我试了几次发现提示这个 no array filter found for identifier 'element' in path请问是咱们 emas mongodb 版本过低,还是什么原因?

展开
收起
真的很搞笑 2023-04-12 11:35:29 366 分享 版权
2 条回答
写回答
取消 提交回答
  • 这个更新语句使用了arrayFilters,它是在MongoDB 3.6版本引入的特性。如果您的EMAS MongoDB版本低于3.6,可能会出现不支持此功能的错误。请确认您的MongoDB版本是否为3.6或更高。如果版本过低,您需要升级MongoDB版本来支持arrayFilters。可参见云数据库 MongoDB 版 公共错误码 错误码
    image.png

    2024-07-15 14:28:17
    赞同 展开评论
  • 移动推送常见问题:https://help.aliyun.com/document_detail/171711.html 热修复常见问题:https://help.aliyun.com/document_detail/172286.html HTTPDNS常见问题:https://help.aliyun.com/document_detail/172238.html 崩溃分析常见问题:https://help.aliyun.com/document_detail/172632.html 移动用户反馈常见问题:https://help.aliyun.com/document_detail/171869.html,此回答整理自钉群“应用研发平台EMAS开发者交流群”

    2023-04-12 12:52:43
    赞同 展开评论