-
Notifications
You must be signed in to change notification settings - Fork 13
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
Get Properties of a relationship #29
Comments
Hey Christopher, For the first query you can change your I don't know why the second example is not running (assumming you called |
Hey Jason, thanks for your response. I have included I run the following but I dont get the properties however: Do I need to include it into the displayed code snippet or somewhere else? For the second issue: When I change I already use relateTo to create the relationship:
Looking forward to your response! |
@ChristopherCODE14 for the first part, try the following: const res = await new QueryBuilder()
.match({ related: [ { model: Products, where: { id: id, }, identifier: 'products', }, { ...Products.getRelationshipByAlias(alias), identifier: alias, }, { model: model, identifier: 'model', }, ], })
.return([ 'products', 'model', alias])
.run(neogma.queryRunner);
console.log(res.records[0]?.get(alias).properties); For the second part, I was wondering what happens if in the exact same place you're calling |
Good morning, yes it is working finally. Thanks for your help! |
Glad to hear that! Please feel free to create more issues for bugs and suggestions |
Good morning,
I have set properties to relationships between two nodes. How can I fetch these properties?
I have tried the following so far and cannot find anything in the documentation:
new QueryBuilder() .match({ related: [ { model: Products, where: { id: id, }, identifier: 'products', }, { ...Products.getRelationshipByAlias(alias), identifier: alias, }, { model: model, identifier: 'model', }, ], }) .return([ 'products', 'model', ]) .run(neogma.queryRunner);
Another option that I have tried is to use findRelationships:
const relationships:any = await Products.findWithRelationships({ alias: alias, where: { source: { id: id1 }, target: { id: id2 }, }, limit: 1 });
However, I here I get the following error message: Product_1.Products.findWithRelationships is not a function
Do you know how to solve the issue and how to make the second code example run, as I also need it for other purposes?
The text was updated successfully, but these errors were encountered: