数据库操作报“error message $ is not defined”错误是什么原因呢?
每一条数据的格式如图所示:

我使用如下代码获取所有id去重后的集合
testAggregate(){ return db.collection( "movie-info" ).aggregate().group({ _id: null , uniqueValues: $.addToSet( '$id' ) }).end() } |
但是一只就是报“error message $ is not defined”的错误。
我本地设置为

还请懂得朋友解答一下,感谢!
【已解决】
没有仔细看官方文档,对小程序云数据库开发和mongodb不太熟悉,以为“$”是小程序开发环境的保留字
如果遇到同样问题的朋友可以参照下方文档
