Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregation match 时多个字段都有 or 操作符,计算的表达式有bug #8

Open
yanguoyu opened this issue May 28, 2021 · 0 comments

Comments

@yanguoyu
Copy link

yanguoyu commented May 28, 2021

encodeQueryObject这个函数
如果处理参数

{
    risk: _.or(_.eq('低'), _.eq('高')),
    scale: _.or(
      _.and(_.gt(200000000), _.lt(1000000000)),
      _.gt(10000000000)
    )
  }

会把 risk 和 scale 处理成 $or

{
"$or":[
    {"risk":{"$eq":"低"}},
    {"risk":{"$eq":"高"}},
    {"$and":[{"scale":{"$gt":200000000}},
    {"scale":{"$lt":1000000000}}]},
    {"scale":{"$gt":10000000000}}
 ]
}

实际上多个字段间应该默认是$and

Wangyaqi added a commit to Wangyaqi/tcb-js-sdk-database that referenced this issue Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant