Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "egg-neo4j", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Neo4J plugin for egg framework", | ||
@@ -5,0 +5,0 @@ "eggPlugin": { |
@@ -20,5 +20,3 @@ # egg-neo4j | ||
<!-- | ||
Description here. | ||
--> | ||
Neo4j for egg framework. | ||
@@ -45,3 +43,9 @@ ## Install | ||
// {app_root}/config/config.default.js | ||
exports.neo4j = {}; | ||
exports.neo4j = { | ||
client: { | ||
url: 'bolt://127.0.0.1', | ||
username: 'neo4j', | ||
password: 'admin', | ||
}, | ||
}; | ||
``` | ||
@@ -53,10 +57,25 @@ | ||
<!-- example here --> | ||
Assume that we have `User` nodes in our database and we want to fetch all of them: | ||
```js | ||
async function all() { | ||
const session = this.ctx.app.neo4j.session(); | ||
try { | ||
const result = await session.run('MATCH(user:User) RETURN user'); | ||
return result.records.map((item) => item.get('user').properties); | ||
} finally { | ||
session.close(); | ||
} | ||
} | ||
``` | ||
## Questions & Suggestions | ||
Please open an issue [here](https://github.com/eggjs/egg/issues). | ||
Please open an issue [here](https://github.com/cemremengu/egg-neo4j/issues). | ||
PRs welcome! | ||
## License | ||
[MIT](LICENSE) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5378
79