Contains filter in Dapr's QueryStateAsync

16 views Asked by At

I have a mongoDb with my data stored (currently as application/json) and I want my frontend to be able to have a search bar where they start searching for a name, e.g type "Tho" when you want to filter on name "Thomas", and by typing "Tho" you should get all entries containing "Tho" in their name.

I'm using DaprClient's QueryStateAsync to query my mongodb with a jsonQuery like this:

StateQueryResponse<Employee> response = await _daprClient.QueryStateAsync<Employee>(DB_NAME, jsonQuery);

The jsonQuery is created on frontend and passed through the entire backend.

Is this possible using the DaprClient or is another client needed for this type of filtering?

ref Dapr documentation: Dapr - How to: Query State

0

There are 0 answers