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

minimongo 'Inconsistent Operator' error when using $elemMatch and $or #1875

Closed
chandika opened this issue Mar 1, 2014 · 3 comments
Closed

minimongo 'Inconsistent Operator' error when using $elemMatch and $or #1875

chandika opened this issue Mar 1, 2014 · 3 comments

Comments

@chandika
Copy link

@chandika chandika commented Mar 1, 2014

Inconsistent Operator error when you use a query like

MyItems.find({users:{$elemMatch:{name:'chandika', $or:[{state:'CA'}, {state:'NC'}]}}});

Reproduction recipe: https://github.com/chandika/meteor-minimongo-elemmatch-or/

Reproduces on 0.7.1.2
Does not reproduce on 0.7.0.1

Trace

Exception from Deps recompute: Error: Inconsistent operator: [object Object]
    at http://localhost:3000/packages/minimongo.js?c6baca6a08ec0589f077a29e773a678aada153ac:1209:13
    at Function._.each._.forEach (http://localhost:3000/packages/underscore.js?0a80a8623e1b40b5df5a05582f288ddd586eaa18:164:22)
    at isOperatorObject (http://localhost:3000/packages/minimongo.js?c6baca6a08ec0589f077a29e773a678aada153ac:1204:5)
    at Object.ELEMENT_OPERATORS.$elemMatch.compileElementSelector (http://localhost:3000/packages/minimongo.js?c6baca6a08ec0589f077a29e773a678aada153ac:1893:11)
    at http://localhost:3000/packages/minimongo.js?c6baca6a08ec0589f077a29e773a678aada153ac:1499:19
    at Function._.each._.forEach (http://localhost:3000/packages/underscore.js?0a80a8623e1b40b5df5a05582f288ddd586eaa18:164:22)
    at operatorBranchedMatcher (http://localhost:3000/packages/minimongo.js?c6baca6a08ec0589f077a29e773a678aada153ac:1477:5)
    at compileValueSelector (http://localhost:3000/packages/minimongo.js?c6baca6a08ec0589f077a29e773a678aada153ac:1392:12)
    at http://localhost:3000/packages/minimongo.js?c6baca6a08ec0589f077a29e773a678aada153ac:1371:9
    at Function._.each._.forEach (http://localhost:3000/packages/underscore.js?0a80a8623e1b40b5df5a05582f288ddd586eaa18:164:22) 
@glasser
Copy link
Member

@glasser glasser commented Mar 1, 2014

Interestingly, Mongo 2.6 (not yet released) has inconsistent treatment of queries like this one: https://jira.mongodb.org/browse/SERVER-12981

@glasser glasser closed this in bd05fdb Mar 1, 2014
@glasser
Copy link
Member

@glasser glasser commented Mar 1, 2014

Thanks for the report; fixed on devel.

@chandika
Copy link
Author

@chandika chandika commented Mar 1, 2014

awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants