Insert - conflict options with a function on nested data
Open
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 118
- Forks
- 161
- PR merge metrics
- No merged PRs in 30d
Description
r.table('table').insert({
id: id,
session: session,
sockets: [{
id: socket_id
}]
}, {conflict: function(id, oldDoc, newDoc) {
return newDoc.merge({
session: session,
sockets: sockets(oldDoc('sockets'), newDoc('sockets'))
});
}})
Adding new objects works fine:
function sockets(oldDoc, newDoc) {
return oldDoc.append({
id: socket_id
});
}
Is it possible to update / remove nested data using oldDoc object?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the insert conflict function and its oldDoc/newDoc expressions in the issue body, especially the nested sockets data. Determine whether oldDoc supports updating or removing nested values, then document the supported behavior and syntax; no repository file or test is named in the report.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- databases, documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100