Spring Data REST is created on top of domain objects and repository abstractions. Thus, letting him work with the storeβs implementation goes beyond him. I assume that your main goal is to apply the PATCH request to your domain instance and that $addToSet is just a means to achieve this.
Starting with version 2.2 of M1 Spring Data REST, we support JSON Patch media type on PATCH request. Thus, you can send the following document to the server:
[{ "op": "add", "path": "/a/b/c", "value": [ "foo", "bar" ] }]
Assuming c is the array you are trying to manipulate, this will add foo and bar to it.
Another - more radical option is to actually deploy the controller with manual input and bind it to the right place in the URI space for manual interaction with the repository.
source share