Recommendation for updating a nested value inside a JSON field?
See original GitHub issueI’d like to update a JSON field by changing one of it’s nested fields.
In mongo, you do this like (http://docs.mongodb.org/manual/reference/operator/update/set/#up._S_set):
instance.update({
json_field: {
"$set": {
"nested_field": "value"
}
}
})
Is there anything like that with Sequelize/Postgres? Right now all I can do is read/write the entire JSON field, it doesn’t seem like I can do deep updates to parts of it.
Issue Analytics
- State:
- Created 8 years ago
- Comments:21 (8 by maintainers)
Top Results From Across the Web
Update a nested value from a Json field - mysql - Stack Overflow
You can create an endpoint that returns the collected data as a JSON document, even if the rows are stored in a normalized...
Read more >Manipulating Nested JSON Values in Java Using the org.json ...
First, we'll need to parse our way into the nested value. The JSON Pointer format provides an intuitive way to reference the nested...
Read more >how to update specific nested json object? : GameSparks
i have that data configuration in my playerData. Now i want to update only the weaponInfo part. for say new weaponInfo will be...
Read more >Update nested json array fileds - Couchbase Forums
Hi, Please share your thought on how to update on below field “UserList”: ... deptEmpCount & deptId are inside userDept object?how to update...
Read more >Updating a nested JSON object with data from a related table…
The JSON structure is arbitrarily nested, I can access objects and fields within the JSON with WITH RECURSIVE , along with some use...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@tudor33sud What I am doing is something like:
Where
objis the object you are trying to append.This will do an atomic append to the array.
This issue is old,
instance.set()supports nested field updates through dot-syntax. It is an atomic operation on database level.