orientechnologies / orientjs

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

can't run examples #429

Closed grimace closed 4 years ago

grimace commented 4 years ago

client = new OrientDB.Client(config); ^ TypeError: OrientDB.Client is not a constructor

steps to reproduce:

git clone https://github.com/orientechnologies/orientjs.git
npm install
cd example
node node client-session-api.js

also, the example code does not work if I build a new project steps:

npm init
npm install --save orientjs
create config.json
create test.js from example ( any )
node test.js

my goal is to determine why my pooling code blows up with everything after 3.0.7, but I can't get the examples to work.

wolf4ood commented 4 years ago

Hi @grimace

i think the examples are outdated

See here

https://github.com/orientechnologies/orientjs#connect-to-orientdb

The client is OrientDBClient. I'm updating the examples

Thanks

wolf4ood commented 4 years ago

For your pool problem do you have an example project where it blows up?

Thanks

grimace commented 4 years ago

I was able to find my problem. I was using the pool config where I should have been using the client config.

{
      name: "demodb",
      user: "xxxxx",
      password: "xxxxx",
      rootUser: "xxxxxx",
      rootPassword: "xxxxx",
      pool: {
        max: 200
      },
      logger: { warning: console.log.bind(null,"OrientDB: ") }
}

although this worked for versions 3.0.7 and before, it did not after. I believe the 'logger' definition in the pool configuration was causing the error. I've done some rewrites on the demo tests. Would you like a pull request?

wolf4ood commented 4 years ago

Hi @grimace

if you have the time for a PR would be cool :)

Thanks