Hi All,

I am fairly new to OrientDB. I am using OrientDB version 2.1.4. I am 
using blueprints-core-2.6.0 Java API for processing. 

I am trying to do the following tasks, but i am not able to achieve the 
targeted performance. Request you to please suggest in case there is any 
better way to  do the same. 

1) Retrieve and Create a Vertex - 
                   The differentiating property for the Vertex is "Name",   
                     

Is there a method using which I can directly create a vertex and it will 
merge into an existing vertex of "Name" xyz if exists. Rest of the 
properties on the vertex should get updated. 

if (graph.getVertices(keyName, key).iterator().hasNext()) {

vertex = (OrientVertex) graph.getVertices(keyName, key)
.iterator().next();

} else {

vertex = graph.addVertex(className, attributeName, key);
                       }

2. Aggregate functions via connected Edges 

For Eg. if I have two Classes extending V ; Device (Name, 
ActiveSessionCount) ->"has" -> Ports (Name, ActiveSessionCount)

How can I do something like - sum(out("has").ActiveSessionCount) from 
Device where Name = 'xyz'


-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to