Closed Masadow closed 8 years ago
I agree. How would suggest integrating into the api?
In the mean time, you can use a cypher query to update a single or set of properties on a node non-destructively.
Sorry, referenced the wrong issue there.
Although it sounds like he was talking about something different, I think the idea of a model.merge
function could work here. Something that works essentially the same way as model.save
, but does an additive update only. What do you think?
Since this API is very close to mongoose which I came from (like many others ?). It would looks familiar to me to have a model.update
method.
model.merge
could also work, but it's less conventional I guess.
Best would be to keep using model.save
, but it would be too much overhead if you ever want to keep deleting keys to know whether or not you want to update or remove keys.
Yeah, I'd be alright with using update
as well. My primary reasoning for not using save
is that seraph-model should behave consistently with seraph, and seraph's behaviour is defined by the neo4j api. Which is how we got here in the first place...
This should be a must. Save always erase everything on update. If a field is not specified, it should not remove it.