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

Why is this code throwing a Error: java.util.LinkedHashMap cannot be cast to java.lang.String? #215

Open
breitmark opened this issue Jun 28, 2018 · 1 comment

Comments

@breitmark
Copy link

       const batch = seraph.batch();
       newNode = batch.save({
           _pr: socket.projectId,
           _name: '<empty>'
       });            batch.label(newNode, [classNode]);            batch.relate(data.source.id, data.relation._name, newNode);            batch.commit((err, results) => {            if (err) {
           console.log('Adding node failed:\n' + err);
       } else {
           ...
      } 
@parties
Copy link

parties commented Jan 18, 2019

I had to fix the formatting to see what was happening in your code, see the questions/comments:

const batch = seraph.batch();

newNode = batch.save({
    _pr: socket.projectId,
    _name: '<empty>'
});

// 1. What is "classNode"?
// This should be a string of the label you wish to apply, not another node.
batch.label(newNode, [classNode]);

// 2. Where are the first and second parameters coming from?
// This could be where the problem is, but it's difficult to tell without knowing what the "data" object is.
batch.relate(data.source.id, data.relation._name, newNode);

batch.commit((err, results) => {
    if (err) {
        console.log('Adding node failed:\n' + err);
    } else {
        // ...
    }
});

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

2 participants