I have documents containing lists of keywords. How can I query such that a search for e.g., the keywords bela
and fleck
returns only documents that have both of those keywords:
{
"_id": "track/bela-fleck/big-country",
"title": "Big Country",
"artist": "Bela Fleck",
"keywords": ["bela", "fleck", "big", "country"]
}
Something like this could work:
...but I have not tested it! Also this does a full database scan, so for efficiency you should create a view in design doc as described in the PouchDb API documentation for Map/Reduce. Hope this helps.
Update... the CouchDb guide also has some detailed examples that may help.