mkj-git opened a new issue, #2742:
URL: https://github.com/apache/incubator-hugegraph/issues/2742

   ### Bug Type (问题类型)
   
   None
   
   ### Before submit
   
   - [x] 我已经确认现有的 [Issues](https://github.com/apache/hugegraph/issues) 与 
[FAQ](https://hugegraph.apache.org/docs/guides/faq/) 中没有相同 / 重复问题 (I have 
confirmed and searched that there are no similar problems in the historical 
issue and documents)
   
   ### Environment (环境信息)
   
   - Server Version: Build from source code
   - Backend: Memory
   - OS: Ubuntu
   - Data Size:  2 vertices
   
   ### Expected & Actual behavior (期望与实际表现)
   
   If primary key is about having a unique value then following test case must 
throw some exception but its passing. Why its silently rejecting second vertex? 
It should have some config that let schema decide that in case of duplicate 
should it be ignored or throw exception.
   
   ```
       @Test
       public void testPrimaryKey() {
   
           HugeGraph graph = graph();
           SchemaManager schema = graph.schema();
   
           schema.propertyKey("prop").asInt().create();
           schema.propertyKey("id").asInt().create();
   
           schema.vertexLabel("user").primaryKeys("prop")
                   .properties("id", "prop").create();
   
           graph.tx().commit();
           graph().addVertex(T.label, "user", "id", 1, "prop", 10);
           graph.tx().commit();
           graph().addVertex(T.label, "user", "id", 1, "prop", 10);
           graph.tx().commit();
   
           List<Vertex> persons = graph().traversal().V()
                   .hasLabel("user").toList();
           Assert.assertEquals(1, persons.size());
       }
   ```
   
   ### Vertex/Edge example (问题点 / 边数据举例)
   
   ```javascript
   
   ```
   
   ### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
   
   ```javascript
   
   ```


-- 
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.

To unsubscribe, e-mail: dev-unsubscr...@hugegraph.apache.org.apache.org

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

Reply via email to