orientdb - How to update a specific record from a class using the query builder in Orientjs (previously called oriento)? -


i need update specific record in user class. don't have field unique index need use @rid field.

how can use orientjs update specific record dynamic properties ?

i use query builder if possible because updated record in request body.

here i've tried :

var id = '#' + req.param('id');  db.update('user').set(req.body).where({@rid: id}).scalar() .then(function (total) { console.log('updated', total, 'users'); }); 

it gives me syntax error because cannot use @rid in clause :

db.update('user').set(req.body).where({@rid: id}).scalar()                                            ^ syntaxerror: unexpected token illegal @ exports.runinthiscontext (vm.js:73:16) @ module._compile (module.js:443:25) @ object.module._extensions..js (module.js:478:10) @ module.load (module.js:355:32) @ function.module._load (module.js:310:12) @ module.require (module.js:365:17) @ require (module.js:384:17) @ object.<anonymous> (/users/alexandre/documents/bitbucket/rest-api/server/routes/index.js:4:12) @ module._compile (module.js:460:26) @ object.module._extensions..js (module.js:478:10) @ module.load (module.js:355:32) @ function.module._load (module.js:310:12) @ module.require (module.js:365:17) @ require (module.js:384:17) @ object.<anonymous> (/users/alexandre/documents/bitbucket/rest-api/server/server.js:25:14) @ module._compile (module.js:460:26) 

try

db.update(id).set(req.body).scalar() 

where id @rid of record want update


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -