DEV Community

Discussion on: Building a RESTful API with Express and MongoDB

Collapse
 
rodrigues profile image
Leandro Rodrigues

Guys just a quick question,

According developer.mozilla.org/en-US/docs/W... the path request should have an array, at the body of the document, with descriptions of changes.
In the provided examples the body of the request is a JSON object which makes a lot of sense to me. Unfortunately, to confuse more my mind I have found this library, github.com/dharmafly/jsonpatch.js, that makes use of the approach that you can see at Mozilla URL.
So my question is: What the correct approach? Which is the recommended design?

Collapse
 
aurelkurtula profile image
aurel kurtula

Unless I am missing something it is an array of object.

Can you copy paste the code you are referring to where you believe I used an array? Then I might be able to help further.

Thanks