adam-cowley / neode

Neo4j OGM for Node.js
MIT License
394 stars 72 forks source link

Node Validation on Schema Update #176

Open alex-laycalvert opened 1 year ago

alex-laycalvert commented 1 year ago

In a project I'm working on, I've recently had to add a new field to an existing SchemaObject. I set it to be required and a default value of false since it's a boolean. It looks like there wasn't any validation fixing to change any existing nodes in the graph which meant that a large amount of the new queries (using cypher) wouldn't return the expected results.

Is there any current way to automatically update any nodes in the graph that don't match the existing schema with their default values if provided or any interest in adding this?

I haven't looked if this happens with the built in match and query methods since the ones we needed to user we had to use a regular Cypher query.

Thanks.