-
Notifications
You must be signed in to change notification settings - Fork 0
/
provisioning.txt
49 lines (44 loc) · 1.2 KB
/
provisioning.txt
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
var r = require('rethinkdb');
var connection = null;
r.connect({
host: 'ec2-52-16-192-128.eu-west-1.compute.amazonaws.com',
port: 28015
}, function (err, conn) {
if (err) {
throw err;
}
connection = conn;
});
r.db('test').tableCreate('member').run(connection, function(err, result) {
if (err) throw err;
console.log(JSON.stringify(result, null, 2));
});
r.table('member').insert({name:"LastName"}).run(connection, function(err, result) {
if (err) throw err;
console.log(JSON.stringify(result, null, 2));
});
r.db('test').tableCreate('cards').run(connection, function(err, result) {
if (err) throw err;
console.log(JSON.stringify(result, null, 2));
});
r.table('cards').insert([{
game: "Starcraft 2",
time: new Date(),
creator: "Thenanox",
description: "Starcraft 2 ladder with zerg, need terran partner",
platform: "Battle.net",
Slots: 1,
waitlist: 0
},
{
game: "Dota 2",
time: new Date(),
creator: "Rubo",
description: "Want to play with 4 partners",
platform: "Steam",
Slots: 4,
waitlist: 0
}]).run(connection, function(err, result) {
if (err) throw err;
console.log(JSON.stringify(result, null, 2));
});