Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation error when creating node #165

Open
matosjoaops opened this issue Apr 12, 2022 · 0 comments
Open

Validation error when creating node #165

matosjoaops opened this issue Apr 12, 2022 · 0 comments

Comments

@matosjoaops
Copy link

matosjoaops commented Apr 12, 2022

I'm trying out some of the sample code inside a docker container (not sure if this is related to the issue, neo4j is also running in a docker container BTW) and I'm getting the following error when I try to create a node:

Error: Not sure how to validate driver on _neode
     at /usr/src/app/node_modules/neode/build/Services/Validator.js:273:15
     at Array.forEach (<anonymous>)
     at /usr/src/app/node_modules/neode/build/Services/Validator.js:247:25
     at Array.forEach (<anonymous>)
     at BuildValidationSchema (/usr/src/app/node_modules/neode/build/Services/Validator.js:165:23)
     at Validator (/usr/src/app/node_modules/neode/build/Services/Validator.js:293:16)
     at /usr/src/app/node_modules/neode/build/Services/Create.js:28:38
     at async connect (file:///usr/src/app/src/index.js:34:5)

This is the code I'm using:

import Neode from "neode";

function msleep(n) {
  Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, n);
}

async function connect() {
  try {

    const instance = new Neode("bolt://neo4j:7687", "neo4j", "password");
    instance.with({
      Person: instance.model("Person", {
        person_id: {
          primary: true,
          type: "uuid",
          required: true, // Creates an Exists Constraint in Enterprise mode
        },
        payroll: {
          type: "number",
          unique: "true", // Creates a Unique Constraint
        },
        name: {
          type: "name",
          index: true, // Creates an Index
        },
        age: "number", // Simple schema definition of property : type
      }),
    });


    await instance.create("Person", {
      name: "Adam",
    });

    const result = await instance.cypher("MATCH (p:Person) RETURN p");

    console.log(result.records[0]);
  } catch (error) {
    console.log(error);
  }
}

msleep(10000);
connect();

Not sure what I'm doing wrong.
Thanks in advance for any help given.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant