How to do a Case Insensitive search on Azure DocumentDb?

前端 未结 3 894
盖世英雄少女心
盖世英雄少女心 2020-12-10 11:15

is it possible to perform a case insensitive search on DocumnetDb?

Let\'s say I have a record with \'name\' key and value as \"Timbaktu\"

This will work:

3条回答
  •  忘掉有多难
    2020-12-10 11:38

    Perhaps this is an ancient case, I just want to provide a workaround.

    You could use UDF in azure cosmos db.

    udf:

    function userDefinedFunction(str){
        return str .toLowerCase();
    }
    

    And use below sql to query results:

    SELECT c.firstName FROM c where udf.lowerConvert(c.firstName) = udf.lowerConvert('John')
    

提交回复
热议问题