How do I perform a case-insensitive search in Neo4j GraphQL with Apollo Server, using an OGM (Object Graph Mapper) model? Please provide suggestions

 let where = { hasUser_ALL: { id_IN: inviteList } };

      if (ProfileWhere && ProfileWhere.displayName_MATCHES) {
        where.displayName_MATCHES = `(?i)${ProfileWhere.displayName_MATCHES}.*`;
      }
      console.log('where==============>', where);
      users = await Profile.find({
          where: where,
          options: options,
          selectionSet: getSelectionSet(info),
      });

where==============> {
hasUser_ALL: {
id_IN: [ 'sEnGHhycEkXsYawSu0W3OJ7l5Sg2', 'b9b3U1CY7GXbbJtpphJRc9rBBz22' ]
},
displayName_MATCHES: '(?i)m.'
}
error: getInviteMembers Variable "$where" got invalid value { hasUser_ALL: { id_IN: [Array] }, displayName_MATCHES: "(?i)m.
" }; Field "displayName_MATCHES" is not defined by type "ProfileWhere". Did you mean "displayName_CONTAINS", "displayName_NOT", "displayName_NOT_IN", "displayName_IN", or "displayName"? {"service":"user-service","stack":"Error: Variable "$where" got invalid value { hasUser_ALL: { id_IN: [Array] }, displayName_MATCHES: "(?i)m.*" }; Field "displayName_MATCHES" is not defined by type "ProfileWhere". Did you mean "displayName_CONTAINS", "displayName_NOT", "displayName_NOT_IN", "displayName_IN", or "displayName"?\n at Model.find (/home/ideal/Desktop/swingist/swingist-graphql-gen2/dist/node_modules/@neo4j/graphql-ogm/dist/classes/Model.js:89:19)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"}

Hi @veerendra.idealittec,

To enable the _MATCHES filter you need to update your OGM constructor to include the features.filters.String.MATCHES object, similar to this:

const ogm = new OGM({
    typeDefs,
    driver,
    features: {
        filters: {
            String: {
                MATCHES: true,
            },
        },
    },
});

More information can be found in the documentation.

Best regards,

Michael