Is it possible to search Vertex properties with a contains in Azure Cosmos Graph DB?
For example, I would like to find all persons which have \'Jr\'
in thei
None of the text matching functions are available for CosmosDB at this time. However, I was able to implement a wildcard search functionality by using a UDF (User Defined Function) which uses the Javascript match() function:
function userDefinedFunction(input, pattern) { return input.match(pattern) !== null; };
Then you'd have to write your query as SQL and use the UDF that you defined (the example below assumes you called you function 'REGEX'
SELECT * FROM c where(udf.REGEX(c.name[0]._value, '.*Jr.*') and c.label='person')
The performance will be far from ideal so you need to decide if the solution is acceptable or not based on your latency and cost perspectives.