ehsanonline opened a new issue #45:
URL: https://github.com/apache/incubator-age/issues/45


   Hello, it would be great if we could use unique keys in nodes and edges. in 
Neo4j it's called [Node 
Key](https://neo4j.com/docs/cypher-manual/current/administration/constraints/#administration-constraints-node-key)
 and it can be used like these:
   
   1. `CREATE CONSTRAINT constraint_name ON (n:Person) ASSERT (n.firstname) IS 
NODE KEY`
   2. `CREATE CONSTRAINT constraint_name ON (n:Person) ASSERT (n.firstname, 
n.surname) IS NODE KEY`
   3. `CREATE CONSTRAINT constraint_name IF NOT EXISTS ON (n:Person) ASSERT 
(n.firstname, n.surname) IS NODE KEY`
   4. `CREATE CONSTRAINT constraint_with_provider ON (n:Label) ASSERT (n.prop1) 
IS NODE KEY OPTIONS {indexProvider: 'native-btree-1.0'}`
   5. `DROP CONSTRAINT constraint_name`
   6. `DROP CONSTRAINT missing_constraint_name IF EXISTS`
   
   I've tried to use Postgres queries but since the `properties` column type is 
not json/jsonb I got error:
   ```sql
   postgres=# CREATE UNIQUE INDEX person_name_idx ON mygraph.person( 
(properties->>'name') ) ;
   ERROR:  operator does not exist: ag_catalog.agtype ->> unknown
   LINE 1: ...INDEX person_name_idx ON mygraph.person( (properties->>'name')...
                                                                  ^
   HINT:  No operator matches the given name and argument types. You might need 
to add explicit type casts.
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to