问题
I am using Neo4j as my graph database. Suppose I want to limit the length of User's name field to be less then 10, is there any way to impost such constraint on the database level?
回答1:
Right now you'd have to do that either on application level, or by registering a transaction-commit hook that checks that property-field for a certain criterium.
See:
- http://docs.neo4j.org/chunked/stable/transactions-events.html
- http://api.neo4j.org/2.0.3/org/neo4j/graphdb/event/TransactionEventHandler.html
来源:https://stackoverflow.com/questions/23822409/database-level-validation-of-neo4j