-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
featureNew feature or requestNew feature or request
Description
I have a User model with a relationships property that looks like this:
Surveys: {
model: Survey,
direction: 'out',
name: 'IS_PARTICIPANT',
properties: {
Feedback: {
property: 'feedback',
schema: {
type: 'string'
}
},
Complete: {
property: 'complete',
schema: {
type: 'boolean'
}
}
}
}
Is there a way to give these a default value or a beforeCreate hook?
When I go to create a user node and associate it with a Survey node, I get a Neo4j error about missing feedback and complete parameters.
I've tried adding a default
value but it does not work.
I was creating my user node like this:
const user = User.createOne({
name: 'John Doe',
email: 'john.doe@acme.co',
department: 'Engineering',
title: 'Software Engineer',
});
await user.relateTo({
alias: 'Surveys',
where: {
target: {
code: "ABC123"
}
}
})
Metadata
Metadata
Assignees
Labels
featureNew feature or requestNew feature or request