How to update an edge by using fluent api
Hi, can you please explain me how to update an edge by using fluent api ?
hi @tiagodavi
do you have the record id of the edge?
Hi. No. I just have the name of it.
On Jan 18, 2017 5:59 AM, "Enrico Risa" [email protected] wrote:
hi @tiagodavi https://github.com/tiagodavi
do you have the record id of the edge?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/orientechnologies/orientjs/issues/228#issuecomment-273408250, or mute the thread https://github.com/notifications/unsubscribe-auth/ABAmLsgWqUnThvC-qRWveptlgr_TOF2dks5rTcZ6gaJpZM4LmDuM .
How would you filter in order to find the edge?
do you have vertices record ids or primary keys?
I just need update "in" and o"ut" of an edge.. I have in, out and the edge name.
Does that make sense?
I have been using db.update for doing this but.. I saw on orientdb documentation that we have to use update edge instead of only update.. so I am worried about that.
Thanks.
Updates edge records in the current database. This is the equivalent of the UPDATE http://orientdb.com/docs/2.1/SQL-Update.html command, with the addition of checking and maintaining graph consistency with vertices, in the event that you update the out and in properties.
http://orientdb.com/docs/2.1/SQL-Update-Edge.html
2017-01-18 14:10 GMT-02:00 Enrico Risa [email protected]:
How would you filter in order to find the edge?
do you have vertices record ids or primary keys?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/orientechnologies/orientjs/issues/228#issuecomment-273519078, or mute the thread https://github.com/notifications/unsubscribe-auth/ABAmLp6SNUG99jF2iC4-g1SK96LEqqx8ks5rTjldgaJpZM4LmDuM .
-- Tiago Davi (MCTS) (21) 98344-4547
I found out how to do it..
There is db.delete('EDGE', name) but there is no db.update('EDGE', name)... so
It works like orient db says..
db.update(EDGE ${name}) .set(fields) .where(conditions) .one()
Yes @tiagodavi
if you change out/in it's better to use update edge since it will take care of updating the vertices pointers also