$.arrayElemAt 示例代码错误
发布于 5 年前 作者 lei04 3924 次浏览 来自 问答

https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-sdk-api/database/command/aggregate/AggregateCommand.arrayElemAt.html

const $ = db.command.aggregate
db.collection('exams').aggregate()
  .project({
    first: $.arraElemAt(['$scores', 0]),
    last: $.arraElemAt(['$scores', -1]),
  })
  .end()

示例代码错误。应为:$.arrayElemAt([’$scores’, 0])

1 回复

已反馈核实

--↓↓👍如果觉得有帮助的话请点个【赞】吧(唏嘘也有小尾巴了,可惜是假的)

回到顶部