What you are doing is correct, and this is why the views have been designed for.
The only commend that I will do is usually with Couchbase we use in range query\uefff that is the last unicode character.
If you look at the beer sample application you will see that this is how we deal with such requirements. Here for example the Java code that look for all the "Breweries with a name starting by ":
If you want to limit the view query to only return those indexes which have ‘nuts’ and not ‘nutsonly’, how would you go about this? I initially thought:
view.StartKey('nuts');
view.EndKey('nuts');
might do the trick but that results in no matches. My guess was the very FIRST unicode character might be the recommended solution?
But getting a non-visible character into the Couchbase admin app was a pain so now I’m wondering if maybe 0020 (aka, a space, the first visible character) is a reasonable alternative?
The view functionality for the admin console is fairly basic. If you think this might be helpful, I suggest you file a bug to add an option to “handily” insert such a character into your JSON.
Space could work as an alternative but is probably not “Correct”.