orientechnologies / orientjs

The official fast, lightweight node.js client for OrientDB
http://orientdb.com
Other
326 stars 67 forks source link

connect ECONNREFUSED 127.0.0.1:2424 #440

Open Emeshka opened 3 years ago

Emeshka commented 3 years ago

I'm trying to connect to demodb at first time, using the example. I'm using Angular, so I installed @types/orientjs and orientjs (with no errors). Following is in the AppComponent.

private OrientDB = this._electronService.remote.require("orientjs");
private client = this.OrientDB.OrientDBClient;

ngOnInit() {
    this.client.connect({
        host: "localhost",
        port: 2424
    })
}

It fails with the message in the header. I searched a bit and found this code. Tried it, the same error. Both console.logs output some objects, but at database.select call it fails:

this.server = this.OrientDB({
  host: 'localhost',
  port: 2424,
  username: 'admin',
  password: 'admin'
});
console.log(this.server);
this.database = this.server.use('demodb');
console.log(this.database);
this.database.select().from('OUser').all()
  .then(function(result) {
    console.log(result);
  });

I'm just learning client-server DBs, I have only an experience of embedded SQLite, so I can make stupid mistakes. Should I also install OrientDB from the official site to use this driver? Or do something besides the code above (this is the only code related to Orientjs in my project)?