Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Import OrientJS driver for OrientDB
- var OrientJs = require('orientjs');
- //Connect to OrientDB server
- var server = OrientJs({
- host: "localhost",
- port: "2480",
- username: "root",
- password: "root"
- });
- //Connect to 'demodb'
- var db = server.use({
- name: 'demodb',
- username: 'root',
- password: 'root'
- });
- console.log("Connected to database")
- //Select all entries in 'Castles' table and print to console
- db.select().from('Castles').all()
- .then(function(result) {
- console.log(result);
- });
- //Close connection to database
- db.close();
- Unhandled rejection OrientDB.ConnectionError [0]: Socket Closed
- at Connection.<anonymous> (C:Program Filesnodejsapollo_servernode_modulesorientjslibtransportbinaryconnection.js:277:16)
- at Object.onceWrapper (events.js:313:30)
- at emitNone (events.js:106:13)
- at Socket.emit (events.js:208:7)
- at endReadableNT (_stream_readable.js:1064:12)
- at _combinedTickCallback (internal/process/next_tick.js:138:11)
- at process._tickCallback (internal/process/next_tick.js:180:9)
Add Comment
Please, Sign In to add comment