0

I have an API I am pinging which queries a cosmos db to return records.

I can filter on a simple string in my api call like so:

// return objects where '_Subject' field equals "filterTest"
string getUrl = $"...baseApiPath/?$filter=_Subject+eq+'filterTest'";

This is working perfectly.

But I cannot figure out the filter syntax to make my API query be based on ARRAY_CONTAINS.

// return objects where '_Attachments' field CONTAINS "945afd138aasdf545a2d1";

How would I do that? Is there a general reference for API filter syntax somewhere?

1 Answer 1

0

If you're asking about how to query, a query against a property with an array of values looks like this:

SELECT * FROM c WHERE ARRAY_CONTAINS(c._Attachments, "945afd138aasdf545a2d1")

Another example in this answer.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.