mirror of https://gitee.com/bigwinds/arangodb
fixed graph examples
This commit is contained in:
parent
89d82f435d
commit
237276c18d
|
@ -531,7 +531,7 @@ def generateArangoshShutdown():
|
|||
print '''
|
||||
if (allErrors.length > 0) {
|
||||
print(allErrors);
|
||||
throw new Error('troubles during generating documentation data; see above.');
|
||||
throw new Error('trouble during generating documentation data; see above.');
|
||||
}
|
||||
'''
|
||||
|
||||
|
|
|
@ -3057,7 +3057,9 @@ Graph.prototype._commonNeighbors = function(vertex1Example, vertex2Example, opti
|
|||
/// @EXAMPLE_ARANGOSH_OUTPUT{generalGraphModuleCommonNeighborsAmount1}
|
||||
/// var examples = require("org/arangodb/graph-examples/example-graph.js");
|
||||
/// var graph = examples.loadGraph("routeplanner");
|
||||
/// graph._countCommonNeighbors({isCapital : true}, {isCapital : true});
|
||||
/// var example = { isCapital: true };
|
||||
/// var options = { includeData: true };
|
||||
/// graph._countCommonNeighbors(example, example, options, options);
|
||||
/// ~ examples.dropGraph("routeplanner");
|
||||
/// @END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
///
|
||||
|
@ -3067,8 +3069,8 @@ Graph.prototype._commonNeighbors = function(vertex1Example, vertex2Example, opti
|
|||
/// @EXAMPLE_ARANGOSH_OUTPUT{generalGraphModuleCommonNeighborsAmount2}
|
||||
/// var examples = require("org/arangodb/graph-examples/example-graph.js");
|
||||
/// var graph = examples.loadGraph("routeplanner");
|
||||
/// | graph._countCommonNeighbors('germanCity/Hamburg', {}, {direction : 'outbound', maxDepth : 2},
|
||||
/// {direction : 'outbound', maxDepth : 2});
|
||||
/// var options = { direction: 'outbound', maxDepth: 2, includeData: true };
|
||||
/// graph._countCommonNeighbors('germanCity/Hamburg', {}, options, options);
|
||||
/// ~ examples.dropGraph("routeplanner");
|
||||
/// @END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
///
|
||||
|
@ -3084,8 +3086,8 @@ Graph.prototype._countCommonNeighbors = function(vertex1Example, vertex2Example,
|
|||
+ ',@ex2'
|
||||
+ ',@options1'
|
||||
+ ',@options2'
|
||||
+ ') FOR a in ATTRIBUTES(e) FOR b in ATTRIBUTES(e[a]) '
|
||||
+ 'SORT ATTRIBUTES(e)[0] RETURN [a, b, LENGTH(e[a][b]) ]';
|
||||
+ ') FOR a in ATTRIBUTES(e) FOR b in ATTRIBUTES(e[a]) '
|
||||
+ 'SORT ATTRIBUTES(e)[0] RETURN [a, b, LENGTH(e[a][b]) ]';
|
||||
optionsVertex1 = optionsVertex1 || {};
|
||||
optionsVertex2 = optionsVertex2 || {};
|
||||
var bindVars = {
|
||||
|
@ -3095,6 +3097,7 @@ Graph.prototype._countCommonNeighbors = function(vertex1Example, vertex2Example,
|
|||
"ex1": ex1,
|
||||
"ex2": ex2
|
||||
};
|
||||
|
||||
var result = db._query(query, bindVars, {count: true}).toArray(),
|
||||
tmp = {}, tmp2={}, returnHash = [];
|
||||
result.forEach(function (r) {
|
||||
|
|
|
@ -7161,7 +7161,7 @@ function AQL_GRAPH_VERTICES (graphName,
|
|||
/// @END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
///
|
||||
/// A route planner example, all common outbound neighbors of Hamburg with any other location
|
||||
/// which have a maximal depth of 2 :
|
||||
/// which have a maximal depth of 2:
|
||||
///
|
||||
/// @EXAMPLE_ARANGOSH_OUTPUT{generalGraphCommonNeighbors2}
|
||||
/// var examples = require("org/arangodb/graph-examples/example-graph.js");
|
||||
|
@ -7184,9 +7184,7 @@ function AQL_GRAPH_COMMON_NEIGHBORS (graphName,
|
|||
'use strict';
|
||||
|
||||
options1 = options1 || {};
|
||||
options1.includeData = false;
|
||||
options2 = options2 || {};
|
||||
options2.includeData = false;
|
||||
let graph_module = require("org/arangodb/general-graph");
|
||||
let graph = graph_module._graph(graphName);
|
||||
let vertexCollections = graph._vertexCollections().map(function (c) { return c.name();});
|
||||
|
|
Loading…
Reference in New Issue