Let’s assume we got a database for todolist and want to query all item that are important and are not already done. In SQL, I will use something like
SELECT * FROM todolist WHERE important = true AND state <> 'done'
How can we perform that type of request in an indexeddb nosql database?
With indexes?
Another way?
Not possible?
As I know to filter result on important = true :
objectstore.index('important').openCursor(IDBKeyRange.only('true'))
But I do not know how to filter on state <> 'done' as we got only IDBKeyRange.only(z).
And I do not know how to filter on both clause.
N.B. : In MongoDB we do :
db.userdetails.find({"date_of_join" : "16/10/2010","education":"M.C.A."})
You will need indexes for that, and you can retrieve the data using a cursor where you can provide one filter.
On my blog (http://www.kristofdegrave.be/2012/01/indexed-db-reading-multiple-records.html?m=1) you can find some more info about it.