update a record to set link type column

75 views
Skip to first unread message

Vipul Maheshwari

unread,
Jul 22, 2015, 10:38:31 AM7/22/15
to OrientDB
I am using orientjs driver, and trying to update a record. The record which i am updating has a column of type link but
when i pass in the rid it throws an error. Can someone suggest me how to do this?

user.w...@gmail.com

unread,
Jul 22, 2015, 10:54:34 AM7/22/15
to OrientDB
Hi,

Can you give me your code?

Regards,
Marco

Vipul Maheshwari

unread,
Jul 22, 2015, 11:04:59 AM7/22/15
to OrientDB
Here the value of column is the name of column where the data is to be inserted, rid has value "#15:5" 
data = {};
data[column] = rid;
orientDb.update(className).set(data)
.where({_id:id}).scalar().then(function(res){
console.log(res);
},function(err){
console.log(err);
});

Vipul Maheshwari

unread,
Jul 23, 2015, 4:36:21 AM7/23/15
to OrientDB, vipu...@gmail.com
Figured out what the problem was. I was passing in rid as string but it takes rid as the object which is returned while querying over the database. 
Reply all
Reply to author
Forward
0 new messages