mirror of https://gitee.com/bigwinds/arangodb
Graph: Fixed `getVertices`
This commit is contained in:
parent
fb9f9f7d26
commit
2024bdf941
|
@ -319,6 +319,8 @@ Graph.prototype.getVertices = function () {
|
|||
wrapper = function(object) {
|
||||
return new Vertex(graph, object);
|
||||
};
|
||||
|
||||
return new Iterator(wrapper, cursor, "[edge iterator]");
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -209,6 +209,18 @@ function GraphBasicsSuite() {
|
|||
assertEqual(23, v2.getProperty("age"));
|
||||
},
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief get all vertices
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
testGetAllVertices : function () {
|
||||
var v1 = graph.addVertex("my_vertex", { test: 123 }),
|
||||
vertices = graph.getVertices(),
|
||||
v2 = vertices.next();
|
||||
|
||||
assertEqual(v1.getProperty('test'), v2.getProperty('test'));
|
||||
},
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief replace a vertex
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -667,7 +667,7 @@ Graph.prototype.getVertices = function () {
|
|||
return graph.constructVertex(object);
|
||||
};
|
||||
|
||||
return new Iterator(wrapper, graph.constructVertex, "[edge iterator]");
|
||||
return new Iterator(wrapper, all, "[edge iterator]");
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in New Issue