云数据库数组的相关方法不能用?

发布于 8 年前作者 kangtao8843 次浏览最后编辑 8 年前来自 issues
const db = cloud.database()
const $ = db.command.aggregate
const _ = db.command   

 let res = await db.collection('plan')
      .aggregate()
      .project({
        first: $.arraElemAt(['$content', ]),
      })
      .end()

报错:TypeError: $.arraElemAt is not a function

1 回复
ryin
ryin1 楼6 年前

案例写错了,仔细看操作符是咋写的,对比就清楚了