-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatabase_orientdb.js
69 lines (63 loc) · 1.11 KB
/
database_orientdb.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
var OrientDB = require('orientjs');
var server = OrientDB({
host: 'localhost',
port: 2424,
username: 'root',
password: 'victorica7'
});
var db = server.use('o2');
/*
db.record.get('#21:0').then(function (record) {
console.log('Loaded records:', record);
})
*/
/*
var sql = 'SELECT FROM topic';
db.query(sql).then(function(results){
console.log(results);
})
*/
/*
var sql = 'SELECT FROM topic WHERE @rid=:id';
var _params = {
params:{
id:'#21:0'
}
};
db.query(sql, _params).then(function(results){
console.log(results);
})
*/
/*
var sql = "INSERT INTO topic (title, description) VALUES(:title, :desc)";
var param = {
params:{
title:'Express',
desc:'Express is framwork for web'
}
}
db.query(sql, param).then(function(results){
console.log(results);
})
*/
/*
var sql = "UPDATE topic SET title=:title WHERE @rid=:rid"
db.query(sql, {
params:{
title:'NPM',
rid:'#22:0'
}
}).then(function(results){
console.log(results);
})
*/
/*
var sql = 'DELETE FROM topic WHERE @rid=:rid';
db.query(sql, {
params:{
rid:'#21:1'
}
}).then(function(results){
console.log(results);
})
*/