From f02420eaa730706dd17cd37e5cceda7837a14c48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Stolarczuk?= Date: Thu, 3 Oct 2019 20:48:04 +0200 Subject: [PATCH 1/2] Call get_keys*() functions properly --- lib/database.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/database.js b/lib/database.js index 36274fc..c3e84fd 100644 --- a/lib/database.js +++ b/lib/database.js @@ -88,7 +88,7 @@ class db { * It has only one param - key (for each returned element). */ get_keys(callback) { - this._db.get_all(callback); + this._db.get_keys(callback); } /** @@ -101,7 +101,7 @@ class db { * It has only one param - key (for each returned element). */ get_keys_above(key, callback) { - this._db.get_above(key, callback); + this._db.get_keys_above(key, callback); } /** @@ -114,7 +114,7 @@ class db { * It has only one param - key (for each returned element). */ get_keys_below(key, callback) { - this._db.get_below(key, callback); + this._db.get_keys_below(key, callback); } /** @@ -129,7 +129,7 @@ class db { * It has only one param - key (for each returned element). */ get_keys_between(key1, key2, callback) { - this._db.get_between(key1, key2, callback); + this._db.get_keys_between(key1, key2, callback); } /** From bdb068b61c0eafb787d6500d4b750a81f30e2cbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Stolarczuk?= Date: Fri, 4 Oct 2019 17:49:45 +0200 Subject: [PATCH 2/2] Add minor doc fixes --- lib/database.js | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/lib/database.js b/lib/database.js index c3e84fd..efa02ac 100644 --- a/lib/database.js +++ b/lib/database.js @@ -43,7 +43,10 @@ const pmemkv = require('bindings')('pmemkv'); -/** @class Main Node.js pmemkv class, it provides functions to operate on data in database. */ +/** @class Main Node.js pmemkv class, it provides functions to operate on data in database. + * If an error/exception is thrown from a method it will contain *status* variable. + * Possible statuses are enumerated in constants.status. +*/ class db { /** * Creates an instance of db. @@ -81,7 +84,7 @@ class db { /** * Executes function for every record stored in db. Callback is called - * only with key of each record. + * only with the key of each record. * * @throws {Error} on any failure. * @param {Function} callback - function to be called for every element stored in db. @@ -92,8 +95,8 @@ class db { } /** - * Executes function for every record stored in db, whose keys are - * greater than *key*. Callback is called only with key of each record. + * Executes function for every record stored in db, whose keys are greater + * than the given *key*. Callback is called only with the key of each record. * * @throws {Error} on any failure. * @param {string} key - sets the lower bound for querying. @@ -105,8 +108,8 @@ class db { } /** - * Executes function for every record stored in db, whose keys are - * less than the *key*. Callback is called only with key of each record. + * Executes function for every record stored in db, whose keys are less than + * the given *key*. Callback is called only with the key of each record. * * @throws {Error} on any failure. * @param {string} key - sets the upper bound for querying. @@ -119,8 +122,8 @@ class db { /** * Executes function for every record stored in db, whose keys are - * greater than *key1* and less than *key2*. Callback is called - * only with key of each record. + * greater than the *key1* and less than the *key2*. Callback is + * called only with the key of each record. * * @throws {Error} on any failure. * @param {string} key1 - sets the lower bound for querying. @@ -171,7 +174,7 @@ class db { /** * Returns number of currently stored elements in db, whose keys are - * greater than *key1* and less than *key2*. + * greater than the *key1* and less than the *key2*. * * @throws {Error} on any failure. * @param {string} key1 - sets the lower bound of counting. @@ -195,7 +198,7 @@ class db { /** * Executes function for every record stored in db, whose keys are - * greater than *key*. + * greater than the given *key*. * * @throws {Error} on any failure. * @param {string} key - sets the lower bound for querying. @@ -207,7 +210,7 @@ class db { /** * Executes function for every record stored in db, whose keys are - * less than the *key*. + * less than the given *key*. * * @throws {Error} on any failure. * @param {string} key - sets the upper bound for querying. @@ -219,7 +222,7 @@ class db { /** * Executes function for every record stored in db, whose keys are - * greater than *key1* and less than *key2*. + * greater than the *key1* and less than the *key2*. * * @throws {Error} on any failure. * @param {string} key1 - sets the lower bound for querying.