Search code examples
azure-cosmosdbazure-cosmosdb-gremlinapi

Cosmos Gremlin API unique property value policy


I have several vertex types (labels), and for each of them i would like a unique property that would stop any additional vertex to be created with the same property. Think phone number for the phone vertices, business number for the organisation vertices, etc.

When i try to alter the indexing policy in my graph, it saves but then reverts back to the previous version. I can't seem to work this out... any assistance out there?

In Neo4J it's this:

CREATE CONSTRAINT book_isbn
FOR (book:Book)
REQUIRE book.isbn IS UNIQUE

Solution

  • So, simple answer... not possible. Any constraints, etc should be handled by a middle layer.