[英]Is it possible to create a unique constraint on a sub-key in ArangoDB?
語境
我們受限於 ArangoDB 建議不要使用以下划線開頭的屬性名稱_
://www.arangodb.com/docs/stable/data-modeling-naming-conventions-attribute-names.html因為我們想確定ArangoDB 在稍后階段不會使用此類屬性。
我們可以添加一個屬性
properties:{myproperty1:'abc',_myUnderscoreProperty:'def'}
,
但是如果我們對代表用戶的文檔執行此操作,則
properties:{_name:'abc',_email:'abc@graphileon.com'}
,
我們需要能夠在properties._name
上創建唯一約束。 但這似乎是不可能的。
問題
這是可能的還是有解決方法?
對的,這是可能的。 您可以在字段properties._name
上創建唯一索引
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.