@@ -24,7 +24,7 @@ _databaseName_, then returns itself.
2424
2525** Arguments**
2626
27- * ** databaseName** : ` string `
27+ - ** databaseName** : ` string `
2828
2929 The name of the database to use.
3030
@@ -38,18 +38,18 @@ db.useDatabase("test");
3838
3939## database.useBasicAuth
4040
41- ` database.useBasicAuth(username, password): this `
41+ ` database.useBasicAuth([ username, [ password]] ): this `
4242
4343Updates the _ Database_ instance's ` authorization ` header to use Basic
4444authentication with the given _ username_ and _ password_ , then returns itself.
4545
4646** Arguments**
4747
48- * ** username** : ` string ` (Default: ` "root" ` )
48+ - ** username** : ` string ` (Default: ` "root" ` )
4949
5050 The username to authenticate with.
5151
52- * ** password** : ` string ` (Default: ` "" ` )
52+ - ** password** : ` string ` (Default: ` "" ` )
5353
5454 The password to authenticate with.
5555
@@ -72,7 +72,7 @@ authentication with the given authentication token, then returns itself.
7272
7373** Arguments**
7474
75- * ** token** : ` string `
75+ - ** token** : ` string `
7676
7777 The token to authenticate with.
7878
@@ -84,6 +84,48 @@ db.useBearerAuth("keyboardcat");
8484// The database instance now uses Bearer authentication.
8585```
8686
87+ ## database.login
88+
89+ ` async database.login([username, [password]]): this `
90+
91+ Validates the given database credentials and exchanges them for an
92+ authentication token, then uses the authentication token for future
93+ requests.
94+
95+ ** Arguments**
96+
97+ - ** username** : ` string ` (Default: ` "root" ` )
98+
99+ The username to authenticate with.
100+
101+ - ** password** : ` string ` (Default: ` "" ` )
102+
103+ The password to authenticate with.
104+
105+ ** Examples**
106+
107+ ``` js
108+ const db = new Database ();
109+ db .useDatabase (" test" );
110+ await db .login (" admin" , " hunter2" );
111+ // The database instance now uses the database "test"
112+ // with an authentication token for the "admin" user.
113+ ```
114+
115+ ## database.version
116+
117+ ` async database.version(): Object `
118+
119+ Fetches the ArangoDB version information for the active database from the server.
120+
121+ ** Examples**
122+
123+ ``` js
124+ const db = new Database ();
125+ const version = await db .version ();
126+ // the version object contains the ArangoDB version information.
127+ ```
128+
87129## database.createDatabase
88130
89131` async database.createDatabase(databaseName, [users]): Object `
@@ -92,27 +134,27 @@ Creates a new database with the given _databaseName_.
92134
93135** Arguments**
94136
95- * ** databaseName** : ` string `
137+ - ** databaseName** : ` string `
96138
97139 Name of the database to create.
98140
99- * ** users** : ` Array<Object> ` (optional)
141+ - ** users** : ` Array<Object> ` (optional)
100142
101143 If specified, the array must contain objects with the following properties:
102144
103- * ** username** : ` string `
145+ - ** username** : ` string `
104146
105147 The username of the user to create for the database.
106148
107- * ** passwd** : ` string ` (Default: empty)
149+ - ** passwd** : ` string ` (Default: empty)
108150
109151 The password of the user.
110152
111- * ** active** : ` boolean ` (Default: ` true ` )
153+ - ** active** : ` boolean ` (Default: ` true ` )
112154
113155 Whether the user is active.
114156
115- * ** extra** : ` Object ` (optional)
157+ - ** extra** : ` Object ` (optional)
116158
117159 An object containing additional user data.
118160
@@ -187,7 +229,7 @@ Deletes **all documents in all collections** in the active database.
187229
188230** Arguments**
189231
190- * ** excludeSystem** : ` boolean ` (Default: ` true ` )
232+ - ** excludeSystem** : ` boolean ` (Default: ` true ` )
191233
192234 Whether system collections should be excluded. Note that this option will be
193235 ignored because truncating system collections is not supported anymore for
0 commit comments