New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

neo4j-func

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

neo4j-func - npm Package Compare versions

Comparing version 1.0.10 to 1.0.11

2

package.json

@@ -5,3 +5,3 @@ {

"homepage": "https://github.com/Milihhard/neo4j-func#readme",
"version": "1.0.10",
"version": "1.0.11",
"keywords": [

@@ -8,0 +8,0 @@ "neo4j",

@@ -5,1 +5,69 @@ # neo4j-func #

It helps making queries by using a functionnal approach
## Installation ##
``` bash
$npm install neo4j-func
```
or
``` bash
$yarn add neo4j-func
```
## Usage ##
### define your nodes and links
For a node :
``` typescript
@node('MyNode')
class MyNode extends NodeNeo4J {
@property()
@notNull
mandatoryProperty: PropertyDefinition<string>;
@property()
property2: PropertyDefinition<string>;
constructor(mandatoryProperty?: string, property2?: string) {
super();
}
}
```
For a link :
``` typescript
@node('MyLink')
class MyLink extends LinkNeo4J {
@property()
@notNull
mandatoryProperty: PropertyDefinition<string>;
@property()
property2: PropertyDefinition<string>;
constructor(mandatoryProperty?: string, property2?: string) {
super();
}
}
```
### run you command ###
``` typescript
const myNode = new MyNode('mandatory', 'optionnal');
new Neo4jCommand()
.match(myNode)
.where(ID(myNode)).equals(myNode.value(myNode.property2))
.returnValue(node)
.run()
.then(result =>
result.records[0].map(record => {
if (result.records.length > 0) {
return result.records[0].MyNode as MyNode;
} else {
return null;
}
})
);
```
`.run` return a promise
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc