Couchbase query using “\uefff” break the next conditional keys

If you need to filter your results by 2 varying ranges you can use LinQ, but if you have large number of documents it can be slow. So to make it faster you can do two things:

  1. After applying LinQ “filter” cache results in memcached or couchbase.
  2. If your datamodel allows you to create separate view for one of the ranges, i.e. if you can move one of your ranges from key to map function if like: View for 21sts:

map: function() { if (doc.subtype === "21sts") emit (doc.abv,null) }

where docs that have subtype == “21sts” are docs that you can get from view with:

map: function() { emit(doc.brewery_id, null) }

and startkey=”21st”, endkey=”21st\uefff”.

Leave a Comment