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

类似这样的查询条件组合起来就异常了 #577

Open
onerain88 opened this issue Sep 10, 2019 · 4 comments
Open

类似这样的查询条件组合起来就异常了 #577

onerain88 opened this issue Sep 10, 2019 · 4 comments

Comments

@onerain88
Copy link

var query = new AV.Query('Account');
query.equalTo('balance', 100);
query.greaterThanOrEqualTo('balance', 100);
query.first().then(account => {
    console.log(account);
});

看代码好像是先 eq 之后,就设置了「基础类型」;再对相同的 key 增加复杂条件,就异常了。

@weakish
Copy link
Contributor

weakish commented Sep 10, 2019

>= 100 应该已经包括了 = 100

@XiaoJianPeng
Copy link

不支持对同一个字段添加不同添加,而且下面的条件已经包含上面的了

:octocat: From gitme Android

@onerain88
Copy link
Author

不是业务上的「限制」,是代码上在 equalTo 之后,就将值设置为了基本类型(number);在 greaterThanOreEqualTo 之后,会在前面的值(number 类型)上做 number[key] = value 导致异常。

@leeyeh
Copy link
Contributor

leeyeh commented Sep 16, 2019

尽管这么用的情况还是比较少见的,这里确实是可以抛出更直接的异常信息。

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

4 participants