We have a bin with a string-list in it. And we want to do a search with a “matches” pattern on a List String element. In the old world, we do that with following code:
I do see that a Contains Aerospike Exrpression is easy to achieve with the List bin type, but Regexp matching not working, is it not supported or is something my team is missing.
When it comes to list data type, you can only match by starting with the first element and not any element within the list – in CDTs - you cannot iterate through the elements presently. This is another post on how match starting element in lists. Searching for the index of specific AAID - #2 by pgupta
static ExpregexCompare(String regex, int flags, Exp bin)
Create expression that performs a regex match on a string bin or string value expression.
regexCompare does not support matching on a list bin’s values.
You can certainly search for a specific string value in the list of string values. i.e. if your list has ["jack", "john", "sally", "bill" ] … you can find if the list contains exact match string for e.g. "sally".