Comments (4)
Looking into this now
from backbone_query.
Hi, the problem is with the formation of your query: http://jsfiddle.net/RZJcJ/1/
I'm updating the api, to accept different types of queries, which should make your second query work. At the moment, if you are using $and/$or/$not/$nor
then you can't have any query parameters outside of those, parent key names.
For your first query, the $or
is incorrectly nested.
Here is a working version:
res1 = Col.query
$and:
equ: 'ok'
$or:
same: 'ok'
res2 = Col.query
$and:
equ: 'bogus' # This item is clearly unavailable
$or:
same: 'ok'
from backbone_query.
@davidgtonge Yout "working" queries are changing the structure of the query. My demo was a simplified case of a complex query.
The first query ought to demonstrate that the following -incorrectly- results in an empty list:
$and: alwaystrue
$or:
something: alwaystrue
another: alwaystrue
from backbone_query.
Ok, the issue is nested $or,$and,$not,$nor
queries.
I've not used these before, but they are part of the mongo spec - so I'm including your fix in the next version.
from backbone_query.
Related Issues (16)
- Nested Models not supported ? HOT 5
- Storing the query part in a db HOT 2
- requirejs + backbone_query HOT 4
- two or more checks on same argument HOT 2
- Typo id docs HOT 1
- dynamic queries not working? HOT 1
- whereBy is making the _events array leak HOT 7
- Implement benchmark.js? HOT 1
- Add bower support HOT 1
- multiple queries against same key in array no longer working (backbone version ~1)
- Search on nested properties HOT 7
- $elemMatch doesn't work with backbone-relational? HOT 5
- Very similar to Query Engine HOT 10
- need to use arrays rather than objects for query object
- Making Backbone-query AMD-compatible
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from backbone_query.