falkordb
TypeScript icon, indicating that this package has built-in type declarations

6.2.5 • Public • Published

Tests Coverage License Discord Twitter

falkordb-ts

Try Free

falkordb is a FalkorDB client for Node.js.

Installation

Start a falkordb via docker:

docker run -p 6379:6379 -it falkordb/falkordb:latest

To install node falkordb, simply:

npm install falkordb

Usage

Basic Example

import { FalkorDB } from 'falkordb';

const db = await FalkorDB.connect({
    username: 'myUsername',
    password: 'myPassword',
    socket: {
        host: 'localhost',
        port: 6379
    }
})

console.log('Connected to FalkorDB')

const graph = db.selectGraph('myGraph')

await graph.query(`CREATE (:Rider {name:'Valentino Rossi'})-[:rides]->(:Team {name:'Yamaha'}),
        (:Rider {name:'Dani Pedrosa'})-[:rides]->(:Team {name:'Honda'}),
        (:Rider {name:'Andrea Dovizioso'})-[:rides]->(:Team {name:'Ducati'})`)

result = await graph.query(`MATCH (r:Rider)-[:rides]->(t:Team) 
                            WHERE t.name = $name RETURN r.name`, 
                            {params: {name: 'Yamaha'}})
                            
console.log(result) // Valentino Rossi

console.log(await db.list())
console.log(await db.info())

db.close()

To learn more about Cypher query language check: https://docs.falkordb.com/cypher/

.close()

Forcibly close a client's connection to FalkorDB immediately. Calling close will not send further pending commands to the Redis server, or wait for or parse outstanding responses.

await client.close();

License

This repository is licensed under the "MIT" license. See LICENSE.

Readme

Keywords

Package Sidebar

Install

npm i falkordb

Weekly Downloads

509

Version

6.2.5

License

MIT

Unpacked Size

98.2 kB

Total Files

75

Last publish

Collaborators

  • gkorland