arangodb / arangojs

The official ArangoDB JavaScript driver.
https://arangodb.github.io/arangojs
Apache License 2.0
600 stars 106 forks source link

db.exists() no longer a function? #793

Closed maininformer closed 11 months ago

maininformer commented 1 year ago

Not sure what's going on, there is supposedly a db.exists but there isn't?

Documentation code

   1 Database = require("arangojs").Database;
   2 db = new Database();
   3 db.exists();

Output

/app/node/test.js:4
TypeError: db.exists is not a function
    at Object.<anonymous> (/app/node/test.js:3:4)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47

Node.js v18.16.1
arangojs@8.4.0 | Apache-2.0 | deps: 5 | versions: 120
The official ArangoDB JavaScript driver.
https://github.com/arangodb/arangojs

keywords: arango, arangodb, aql, nosql, client, driver, api, http, rest

dist
.tarball: https://registry.npmjs.org/arangojs/-/arangojs-8.4.0.tgz
.shasum: b1269c4db45d0f1f032a40af02801edadb6f24eb
.integrity: sha512-WHirnoGL0cHZt/qw3gR/SPXc19SJ0UANYZL90wBWIFnxO/itzN/N8Ss9ylXnCBi8Iz34XmUAvMCjF4C90AKW2A==
.unpackedSize: 2.2 MB

dependencies:
@types/node: >=14       path-browserify: ^1.0.1 xhr: ^2.4.1
multi-part: ^4.0.0      x3-linkedlist: 1.2.0

maintainers:
- nikhilvarma <nikhilvarma892@gmail.com>
- fceller <frank@arangodb.com>
- pluma4345 <alan.plum-extern@arangodb.com>
- jsteemann <jsteemann@mail.ru>
- hkernbach <heiko.kernbach@gmail.com>

dist-tags:
latest: 8.4.0     next: 8.0.0-rc.1

published 5 days ago by pluma4345 <alan.plum-extern@arangodb.com>

Many Thanks

pluma4345 commented 12 months ago

It doesn't look like you're using arangojs 8.4.0 despite what the second snippet says. Can you check your node_modules/arangojs/package.json or your lockfile?

maininformer commented 12 months ago

I have moved to golang driver since. But you are correct, it is 5.8 which is strange since I used npm i iirc, expecting the latest.

pluma4345 commented 11 months ago

Thank you for the confirmation.