{"id":14959446,"url":"https://github.com/graphaware/node-neo4j-bolt-adapter","last_synced_at":"2025-10-07T11:36:57.089Z","repository":{"id":57311470,"uuid":"96846670","full_name":"graphaware/node-neo4j-bolt-adapter","owner":"graphaware","description":"An adapter for the official neo4j-javascript-driver, allowing it to be used as a drop-in replacement for the node-neo4j community driver. ","archived":false,"fork":false,"pushed_at":"2019-08-10T19:24:23.000Z","size":19,"stargazers_count":5,"open_issues_count":2,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-09-27T07:54:44.794Z","etag":null,"topics":["adapter","community","javascript","neo4j","official"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/graphaware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-11T03:27:54.000Z","updated_at":"2024-01-21T14:07:40.000Z","dependencies_parsed_at":"2022-09-10T22:10:38.742Z","dependency_job_id":null,"html_url":"https://github.com/graphaware/node-neo4j-bolt-adapter","commit_stats":null,"previous_names":["appsquickly/node-neo4j-bolt-adapter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/graphaware/node-neo4j-bolt-adapter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fnode-neo4j-bolt-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fnode-neo4j-bolt-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fnode-neo4j-bolt-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fnode-neo4j-bolt-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphaware","download_url":"https://codeload.github.com/graphaware/node-neo4j-bolt-adapter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fnode-neo4j-bolt-adapter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278765623,"owners_count":26042030,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adapter","community","javascript","neo4j","official"],"created_at":"2024-09-24T13:19:45.247Z","updated_at":"2025-10-07T11:36:57.037Z","avatar_url":"https://github.com/graphaware.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"An adapter to allow the official \u003ca href=\"https://github.com/neo4j/neo4j-javascript-driver\"\u003eNeo4j bolt driver\u003c/a\u003e \nto be used as a drop in replacement for the \u003ca href=\"https://github.com/thingdom/node-neo4j\"\u003enode-neo4j\u003c/a\u003e community \ndriver. \n\n# Usage\n\nGiven the node-neo4j community driver declared as follows: \n\n```javascript 1.6\nconst Promise = require('bluebird')\nconst neo4j = require('node-neo4j')\nconst dev = require('./dev')\nconst db = Promise.promisifyAll(new neo4j(\n  `http://${process.env.DB_USER}:${process.env.DB_PW}@${process.env.DB_HOST}:7474`))\n\nmodule.exports = db;\n\n```\n\nAnd used like:\n \n ```javascript 1.6\n\nconst db = require('db')\n\ndb.cypherQueryAsync(`MATCH (u:User) WHERE u.applicationToken = {applicationToken} RETURN U`, \n    {applicationToken: 1234})\n    .then(result =\u003e {\n        //result.columns describes format\n        //When a single record is return result.data contains an object, otherwise an array of objects.  \n    });\n```\n\nWe can define an adapter for the official bolt driver: \n\n```javascript 1.6\nconst neo = require('neo4j-driver').v1;\nconst authToken = neo.auth.basic(userName, password);\nconst db = new BoltAdapter(neo.driver(`bolt://localhost`, authToken));\n```\n\nAnd use it as an API compatible drop-in replacement:\n\n## For a read transaction:\n\n```javascript 1.6\ndb.cypherQueryAsync(`MATCH (u:User) WHERE u.applicationToken = {applicationToken} RETURN U`, \n    {applicationToken: 1234})\n    .then(result =\u003e {\n        //result.columns describes format\n        //When a single record is return result.data contains an object, otherwise an array of objects.  \n    });\n```    \n\nA session will be opened and a transaction initiated, with auto commit or rollback if an error is thrown. On completion the session will be closed. \n\n## For a write transaction\n\n```javascript 1.6\n//For write transactions \ndb.writeQueryAsync(`CREATE (u:User {name: 'Fred'}) return u`)\n    .then(result =\u003e {\n        //result.columns describes format\n        //When a single record is return result.data contains an object, otherwise an array of objects.  \n    });\n\n```\n\nSimilar to a read transaction, a session will be opened and a transaction initiated. The session is closed on completion.\n \n## Closing\n \n```javascript 1.6\n//We can keep a reference, or alternatively, to close the underlying bolt driver\ndb.close() \n```\n\n## Note\n\nCurrently access mode and read/write transaction functions in the official driver are mostly hints. They are not yet translated to access mode on the server - only used by routing driver to decide where to point the request. Until that behavior changes, it is possible to write in a read transaction. \n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphaware%2Fnode-neo4j-bolt-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphaware%2Fnode-neo4j-bolt-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphaware%2Fnode-neo4j-bolt-adapter/lists"}