Skip to content

Commit

Permalink
fix errors in database operations examples; change npm version
Browse files Browse the repository at this point in the history
  • Loading branch information
Temii committed Feb 15, 2021
1 parent 6ce377a commit f90f422
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions examples/database-operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ const IMMUDB_PWD: string = (process.env.IMMUDB_PWD as string || 'immudb');

(async () => {
try {
const randString: string = `${Math.floor(Math.random() * Math.floor(100000))}`;
const randNumber: number = +randString;
const randNumber = 1
const randString: string = `test${randNumber}`;

let index: any;

// Instantiate the client
Expand Down Expand Up @@ -104,13 +105,13 @@ const IMMUDB_PWD: string = (process.env.IMMUDB_PWD as string || 'immudb');
const res7 = await client.txById({
tx: index
})
console.log('success: byIndex', res7);
console.log('success: txById', res7);

// // safely return an element by index
const res8 = await client.verifiedTxById({
tx: index
})
console.log('success: bySafeIndex', res8);
console.log('success: verifiedTxById', res8);

// fetch history for the item having the
// specified key
Expand All @@ -120,7 +121,6 @@ const IMMUDB_PWD: string = (process.env.IMMUDB_PWD as string || 'immudb');
limit: 0,
desc: false,
sincetx: randNumber

})
console.log('success: history', res9);

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

// iterate over a sorted set
const res12 = await client.zAdd({
set: randString,
key: '10',
set: '10',
key: randString,
score: 5,
})
console.log('success: zScan', res12);
console.log('success: zAdd', res12);

// execute a batch read
const res14 = await client.getAll({
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "immudb-node",
"version": "1.0.9.rc-1",
"version": "1.0.9-rc.1",
"description": "Node ts client for immudb",
"directories": {
"lib": "lib",
Expand Down

0 comments on commit f90f422

Please sign in to comment.