Skip to content

Commit ded18c7

Browse files
committed
chore: updated examples
1 parent 9178b6d commit ded18c7

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

examples/database-operations-long-index.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ const IMMUDB_USER = process.env.IMMUDB_USER || 'immudb'
2020
const IMMUDB_PWD = process.env.IMMUDB_PWD || 'immudb'
2121

2222
ImmudbClient({
23-
address: `${IMMUDB_HOST}:${IMMUDB_PORT}`,
24-
rootPath: 'rootfile'
25-
}, main)
23+
address: `${IMMUDB_HOST}:${IMMUDB_PORT}`,
24+
rootPath: 'rootfile'
25+
}, main)
26+
27+
const rand = '' + Math.floor(Math.random()
28+
* Math.floor(100000))
2629

27-
const rand = '1'
28-
const testDB = 'opsdb'
29-
3030
async function main(err, cl) {
3131
if (err) {
3232
return console.log(err)
@@ -39,12 +39,12 @@ async function main(err, cl) {
3939
console.log('success: login', res)
4040

4141
// create database
42-
req = { database: testDB }
42+
req = { database: rand }
4343
res = await cl.createDatabase(req)
4444
console.log('success: createDatabase', res)
4545

4646
// use database just created
47-
req = { database: testDB }
47+
req = { database: rand }
4848
res = await cl.useDatabase(req)
4949
console.log('success: useDatabase', res)
5050

examples/database-operations.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ ImmudbClient({
2424
rootPath: 'rootfile'
2525
}, main)
2626

27-
const rand = '' + Math.floor(Math.random()
28-
* Math.floor(100000))
27+
const rand = '1'
28+
const testDB = 'opsdb'
2929

3030
async function main(err, cl) {
3131
if (err) {
@@ -39,12 +39,12 @@ async function main(err, cl) {
3939
console.log('success: login', res)
4040

4141
// create database
42-
req = { database: rand }
42+
req = { database: testDB }
4343
res = await cl.createDatabase(req)
4444
console.log('success: createDatabase', res)
4545

4646
// use database just created
47-
req = { database: rand }
47+
req = { database: testDB }
4848
res = await cl.useDatabase(req)
4949
console.log('success: useDatabase', res)
5050

0 commit comments

Comments
 (0)