Multiple inequality conditions (range queries) in NoSQL
Posted
by pableu
on Stack Overflow
See other posts from Stack Overflow
or by pableu
Published on 2010-06-17T12:52:08Z
Indexed on
2010/06/17
13:03 UTC
Read the original article
Hit count: 258
Hi,
I have an application where I'd like to use a NoSQL database, but I still want to do range queries over two different properties, for example select all entries between times T1 and T2 where the noiselevel is smaller than X. On the other hand, I would like to use a NoSQL/Key-Value store because my data is very sparse and diverse, and I do not want to create new tables for every new datatype that I might come across.
I know that you cannot use multiple inequality filters for the Google Datastore (source). I also know that this feature is coming (according to this).
I know that this is also not possible in CouchDB (source).
I think I also more or less understand why this is the case.
Now, this makes me wonder.. Is that the case with all NoSQL databases? Can other NoSQL systems make range queries over two different properties?
How about, for example, Mongo DB? I've looked in the Documentation, but the only thing I've found was the following snippet in their docu:
Note that any of the operators on this page can be combined in the same query document. For example, to find all document where j is not equal to 3 and k is greater than 10, you'd query like so:
db.things.find({j: {$ne: 3}, k: {$gt: 10} });
So they use greater-than and not-equal on two different properties. They don't say anything about two inequalities ;-)
Any input and enlightenment is welcome :-)
© Stack Overflow or respective owner