Created
September 26, 2016 21:52
-
-
Save edinsoncs/e92a21ad641c9cdbc41a63ab7e0b7178 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Import to module database RethinkDB | |
var r = require('rethinkdb'); | |
r.connect({ host: 'localhost', port: 28015 }, function(err, conn) { | |
if (err) { | |
return err; | |
} else { | |
/*r.db('usuarios').tableCreate('paises').run(conn, function(err, res){ | |
if(err) throw err; | |
r.table('paises').insert({name: 'Brasil'}).run(conn, function(err, res){ | |
if(err) throw err; | |
console.log(doc); | |
}); | |
});*/ | |
/* r.db('usuarios').table('paises').run(conn, function(err, res) { | |
res.table('paises') | |
.insert({ | |
'name': 'Edinson', | |
'skills': 'Developer Frontend and Backend', | |
'Hobby': 'Listen to music', | |
'live': 'Argentina', | |
'from': 'Peruvian', | |
'job': 'Programmer' | |
}) | |
.run(conn, function(err, res) { | |
if (err) throw err; | |
console.log(res); | |
}); | |
}); */ | |
r.db('usuarios').table('paises') | |
.insert({ | |
'name': 'Edinson', | |
'skills': 'Developer Frontend and Backend', | |
'Hobby': 'Listen to music', | |
'live': 'Argentina', | |
'from': 'Peruvian', | |
'job': 'Programmer' | |
}).run(conn, function(err, res){ | |
if(err) throw err; | |
console.log(res); | |
}) | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment