User response will be in JSON format like { title : string, sub : string, content : string}
If user search for something, first it will look on the local database & later it will send query to server
For this, that search text may be in title or sub or content. To filter out those results we can use pouchdb query (map function). But i am trying to find a way to achieve this using primary index _id itself.
In pouchdb page, i got to know about pouchdb collate which will combine array of keys into single form and later we can use it as primary key. So i decided to collate 2 fields title & sub and made it as _id.
Here after only i am facing the issue, i don't know how to filter out some of the docs if sub contains <some string>
I have created a sample gist for the same - http://bl.ocks.org/joshongit/a0a232fab9a83ce5ef7b Click on "generate doc" will generate 10 random string docs & will print the doc details. And you can paste some string in text box & click filter will look for search string ( this is my use case)
PS : Also pouchdb collate is creating some random number - that is also i don't know why its meant for.