node-lmdb | Node.js binding for lmdb | Runtime Evironment library

 by   Venemo C++ Version: 0.10.1 License: MIT

kandi X-RAY | node-lmdb Summary

kandi X-RAY | node-lmdb Summary

node-lmdb is a C++ library typically used in Server, Runtime Evironment, Nodejs applications. node-lmdb has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

Just like with any other node module, the first step is to require() the module. Env represents a database environment. You can create one with the new operator and after that, you must open it before you can use it. open() accepts an object literal in which you can specify the configuration options for the environment. Close the environment when you no longer need it. An environment (Env) can contain one or more databases. Open a database with env.openDbi() which takes an object literal with which you can configure your database. Close the database when you no longer need it. The basic unit of work in LMDB is a transaction, which is called Txn for short. Here is how you operate with your data. Every piece of data in LMDB is referred to by a key. You can use the methods getString(), getBinary(), getNumber() and getBoolean() to retrieve something, putString(), putBinary(), putNumber() and putBoolean() to store something and del() to delete something. IMPORTANT: always close your transactions with abort() or commit() when you are done with them. You can batch together a set of operations to be processed asynchronously with node-lmdb. Committing multiple operations at once can improve performance, and performing a batch of operations and using sync transactions (slower, but maintains crash-proof integrity) can be efficiently delegated to an asynchronous thread. In addition, writes can be defined as conditional by specifying the required value to match in order for the operation to be performed, to allow for deterministic atomic writes based on prior state. The batchWrite method accepts an array of write operation requests, where each operation is an object or array. If it is an object, the supported properties are: * db (required) - The database to write to * key (required) - The key to write * value (optional) - If specified, this is the value to put into the entry. If absent or undefined, this write operation will be a delete, and delete this key. This should be a binary/buffer value. * ifValue (optional) - If specified, the write operation (put or delete) will only be performed if the provided ifValue matches the existing value for this entry. This should be a binary/buffer value. * ifExactMatch (optional) - If set to true, the conditional write requires that ifValue exactly match the existing value, byte for byte and length. By default ifValue can be a prefix and only needs to match the number of bytes in ifValue (for example if ifValue is Buffer.from([5, 2]), the conditional write will be performed if the value starts with 5, 2). * ifKey (optional) - If specified, indicates the key to use for for matching the conditional value. By default, the key use to match ifValue is the same key as the write operation. * ifDB (optional) - If specified, indicates the db to use for for matching the conditional value. By default, the key use to match ifValue is the same db as the write operation. If the write operation is a specified with an array, the supported elements are: * A three element array for put`ing data: `[db, key, value] (where value is a binary/buffer) * A two element array for del`eting data: `[db, key] * A four element array for conditionally put`ing or `del`eting data: `[db, key, value, ifValue] (where value and ifValue are as specificied in the object definition).
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              node-lmdb has a low active ecosystem.
              It has 341 star(s) with 68 fork(s). There are 18 watchers for this library.
              There were 1 major release(s) in the last 6 months.
              There are 21 open issues and 120 have been closed. On average issues are closed in 158 days. There are 12 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of node-lmdb is 0.10.1

            kandi-Quality Quality

              node-lmdb has no bugs reported.

            kandi-Security Security

              node-lmdb has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              node-lmdb is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              node-lmdb releases are available to install and integrate.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of node-lmdb
            Get all kandi verified functions for this library.

            node-lmdb Key Features

            No Key Features are available at this moment for node-lmdb.

            node-lmdb Examples and Code Snippets

            No Code Snippets are available at this moment for node-lmdb.

            Community Discussions

            Trending Discussions on node-lmdb

            QUESTION

            node embed databases with faster search speed
            Asked 2017-Sep-23 at 13:33

            Actually im using SQlite to store some list of "files" with some attributes, no relational data only one file with multiple data, so i think any relational or nosql DB is valid for me. The problem right now is the Speed of the searchs, I need to embed the db using Node and storing a file in the project folder, actually im using node sqlite3, but i tested yerterday the better-sqlite3 module to, and the results are similar.

            My table structure is like this:

            ...

            ANSWER

            Answered 2017-Sep-22 at 08:40

            Try LMDB with Node-LMDB

            The performance is quite good and for your use case it looks to be an ideal one. I could achieve 1,000,000 rows/sec per client.

            Source https://stackoverflow.com/questions/46360028

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install node-lmdb

            You can download it from GitHub.

            Support

            Tested and works on Linux (author uses Fedora). Tested and works on Mac OS X. Tested and works on Windows.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • npm

            npm i node-lmdb

          • CLONE
          • HTTPS

            https://github.com/Venemo/node-lmdb.git

          • CLI

            gh repo clone Venemo/node-lmdb

          • sshUrl

            git@github.com:Venemo/node-lmdb.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link