Skip to content

Commit f90f422

Browse files
committed
fix errors in database operations examples; change npm version
1 parent 6ce377a commit f90f422

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

examples/database-operations.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ const IMMUDB_PWD: string = (process.env.IMMUDB_PWD as string || 'immudb');
2020

2121
(async () => {
2222
try {
23-
const randString: string = `${Math.floor(Math.random() * Math.floor(100000))}`;
24-
const randNumber: number = +randString;
23+
const randNumber = 1
24+
const randString: string = `test${randNumber}`;
25+
2526
let index: any;
2627

2728
// Instantiate the client
@@ -104,13 +105,13 @@ const IMMUDB_PWD: string = (process.env.IMMUDB_PWD as string || 'immudb');
104105
const res7 = await client.txById({
105106
tx: index
106107
})
107-
console.log('success: byIndex', res7);
108+
console.log('success: txById', res7);
108109

109110
// // safely return an element by index
110111
const res8 = await client.verifiedTxById({
111112
tx: index
112113
})
113-
console.log('success: bySafeIndex', res8);
114+
console.log('success: verifiedTxById', res8);
114115

115116
// fetch history for the item having the
116117
// specified key
@@ -120,7 +121,6 @@ const IMMUDB_PWD: string = (process.env.IMMUDB_PWD as string || 'immudb');
120121
limit: 0,
121122
desc: false,
122123
sincetx: randNumber
123-
124124
})
125125
console.log('success: history', res9);
126126

@@ -151,11 +151,11 @@ const IMMUDB_PWD: string = (process.env.IMMUDB_PWD as string || 'immudb');
151151

152152
// iterate over a sorted set
153153
const res12 = await client.zAdd({
154-
set: randString,
155-
key: '10',
154+
set: '10',
155+
key: randString,
156156
score: 5,
157157
})
158-
console.log('success: zScan', res12);
158+
console.log('success: zAdd', res12);
159159

160160
// execute a batch read
161161
const res14 = await client.getAll({

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "immudb-node",
3-
"version": "1.0.9.rc-1",
3+
"version": "1.0.9-rc.1",
44
"description": "Node ts client for immudb",
55
"directories": {
66
"lib": "lib",

0 commit comments

Comments
 (0)