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

Wrapper for neo4j tu use it in a functionnal way

  • 1.2.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

neo4j-func

Coverage Status Testing app Building Publish to npm

neo4j-func is a neo4j wrapper for node.js
It helps making queries by using a functional approach

Installation

$npm install neo4j-func

or

$yarn add neo4j-func

Usage

define the config file

# neo4j.yaml
host: 0.0.0.0
port: 7687
credentials:
    user: neo4j
    password: neo4j

For a node :

@node('MyNode')
class MyNode extends NodeNeo4J {
    @property()
    @notNull
    mandatoryProperty: PropertyDefinition<string>;
    @property()
    property2: PropertyDefinition<string>;

    constructor(mandatoryProperty?: string, property2?: string) {
        super();
    }
}

For a link :

@node('MyLink')
class MyLink extends LinkNeo4J {
    @property()
    @notNull
    mandatoryProperty: PropertyDefinition<string>;
    @property()
    property2: PropertyDefinition<string>;

    constructor(mandatoryProperty?: string, property2?: string) {
        super();
    }
}

run you command

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

Keywords

FAQs

Package last updated on 06 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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