云数据库数组的相关方法不能用?
发布于 7 年前 作者 kangtao 8697 次浏览 来自 官方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 回复

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

回到顶部