json-server icon indicating copy to clipboard operation
json-server copied to clipboard

Push to a nested array using PATCH?

Open owengot opened this issue 5 years ago • 4 comments

I am using JSON server to create a simple API. I would like to update a nested array in this case the videos array in the playlist with id 'default':

"playlists": [
   {
      "id": "default",
      "videos": [
        {
          "id": 123
        },
        {
          "id": 456
        }
      ]
    }
 ]

There is a method described here by sending a specific payload, but having tried this I don't think it is supported by json-server.

My question is whether there is an easy way to update a nested array using a PATCH request?

owengot avatar Nov 29 '19 22:11 owengot

I have the same problem. Any answer for this question ?

hagad avatar Mar 12 '20 09:03 hagad

me too have this problem :(

mrezah1 avatar Nov 10 '21 21:11 mrezah1

Currently having this problem

stevexero avatar May 21 '22 08:05 stevexero

Having this problem as well 😢

nabruna avatar Jun 24 '22 17:06 nabruna