Skip to content

Commit

Permalink
Clarify that toJSON returns frozen objects
Browse files Browse the repository at this point in the history
  • Loading branch information
kriszyp committed Oct 28, 2024
1 parent 2efc6ba commit f4c0511
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/technical-details/reference/resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ product1.delete('additionalInformation');
product1.update();
```
You can also get "plain" object representation of a resource instance by calling `toJSON`, which will return a simple object with all the properties (whether defined in the schema) as direct normal properties:
You can also get "plain" object representation of a resource instance by calling `toJSON`, which will return a simple frozen object with all the properties (whether defined in the schema) as direct normal properties (note that this object can *not* be modified, it is frozen since it is belongs to a cache):
```javascript
let product1 = await Product.get(1);
Expand Down

0 comments on commit f4c0511

Please sign in to comment.