Local API - array operations for payload.update
#1515
lkostrowski
started this conversation in
Feature Requests & Ideas
Replies: 1 comment
-
It would be great to have such an operation, I'm sure there are many use cases for this, maybe we can even expose the object we are updating. For example, let's say we have a collection A with field A1 that is an array. When we payload.update (or any other relevant method), we can pass the A1 field and manipulate it. Not necessarily exposing the data in that field, but telling the payloadApi that once you execute this method/function look at field A1 and manipulate it in this way. I hope you are able to understand my extension to this feature request and can give it a thought. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Let's say I implement
afterChange
hook on the collection. I want to push ID of document to another document (simulate bi-directional relationship). Document I edit has a collection:in
children
I want to push to array, not overwrite it. To do this, I have toawait payload.find()
first and then spread array with the new document.There should be some simple array operations, similar to query operations. For example
Beta Was this translation helpful? Give feedback.
All reactions