How do i user arrayFilters on updateOne with data api

on the document page i don’t see an option to set arrayFilters

Hey @Trieu_Boo,

Thank you for reaching out to the MongoDB Community forums.

Currently, the usage of arrayFilters is not supported in the Data API. It is limited to the upsert option when utilizing the updateOne and updateMany endpoints.

I would recommend using a driver when dealing with queries that you believe require the use of arrayFilters.

In case of any further questions feel free to reach out.


1 Like

Hi @Trieu_Boo,

Vote for the feature request if it is really helpful for you,

The alternative approach is to create a custom HTTP endpoint, design your request, and execute an update query in a function.

same question here:
is it now possible to use “options” with “arrayFilters” to update a field of a document using the API, V1, and fetch from a browser (ie javascript)?

If not, is there a plan to include it in the near future?

For reference, my code snippet is:

                'filter': {
                    'metadata.hashed_url': hashed_url
                "update": {
                    "$set": {
                        "elements.note.$[index].highlightColor": colorNum
               "options": { "arrayFilters": [{ "": id }]}

I get an error: “Invalid parameter(s) specified: options” in the console of the browser