比如例子中,如果对number 建立唯一性约束,那么如果原表有重复的话就不能新建一条记录了。(不对,这里应该叫不能创建一条重复的节点了) 建立约束: CREATE CONSTRAINT ON (cc:CreditCard) ASSERT cc.number IS UNIQUE
MATCH (cc:CreditCard) RETURN cc.id,cc.number,cc.name,cc.expiredate,cc.cvv
删除约束: DROP CONSTRAINT ON (cc:CreditCard) ASSERT cc.number IS UNIQUE
建立一个重复的节点(相对于number) CREATE (cc:CreditCard {id:22,number:222222,name:'BBB',expiredate:'10/10/2017',cvv:222})
再建立一个重复的节点(相对于number) CREATE (cc:CreditCard {id:22,number:222222,name:'BBB',expiredate:'10/10/2017',cvv:333})
查询检索一个节点 MATCH (cc:CreditCard) RETURN cc.id,cc.number,cc.name,cc.expiredate,cc.cvv