相关疑难解决方法(0)

MongoDB - $ size的参数必须是一个数组,但类型为:EOO

尝试使用icCube创建MongoDB数据源.我们的想法是将数组的大小作为新字段返回.就像是 :

$project:
{ 
 "people": 1, 
 "Count myFieldArray" : {$size : "$myFieldArray" }
}
Run Code Online (Sandbox Code Playgroud)

但我得到一些记录以下错误:

The argument to $size must be an Array, but was of type: EOO
Run Code Online (Sandbox Code Playgroud)

如果字段为空或不是数组(摆脱错误),是否有一种方法大小为0?

mongodb mongodb-query aggregation-framework iccube

50
推荐指数
2
解决办法
1万
查看次数