mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of github.com:triAGENS/ArangoDB into devel
This commit is contained in:
commit
7aaf9cd0c3
|
@ -4854,7 +4854,7 @@ function RESOLVE_GRAPH_TO_DOCUMENTS (graphname, options) {
|
||||||
toVertices : DOCUMENTS_BY_EXAMPLE(
|
toVertices : DOCUMENTS_BY_EXAMPLE(
|
||||||
toCollection.filter(removeDuplicates), options.toVertexExample
|
toCollection.filter(removeDuplicates), options.toVertexExample
|
||||||
),
|
),
|
||||||
edges : DOCUMENTS_BY_EXAMPLE(edgeCollections.filter(removeDuplicates), options.edgeExample),
|
edges : DOCUMENTS_BY_EXAMPLE(edgeCollections.filter(removeDuplicates), options.edgeExamples),
|
||||||
edgeCollections : edgeCollections,
|
edgeCollections : edgeCollections,
|
||||||
fromCollections : fromCollections,
|
fromCollections : fromCollections,
|
||||||
toCollection : toCollection
|
toCollection : toCollection
|
||||||
|
@ -5189,7 +5189,21 @@ function TRAVERSAL_PARAMS (params) {
|
||||||
|
|
||||||
function MERGE_EXAMPLES_WITH_EDGES (examples, edges) {
|
function MERGE_EXAMPLES_WITH_EDGES (examples, edges) {
|
||||||
var result = [],filter;
|
var result = [],filter;
|
||||||
if (examples.length === 0) {
|
if (examples === "null") {
|
||||||
|
examples = [{}];
|
||||||
|
}
|
||||||
|
if (!examples) {
|
||||||
|
examples = [{}];
|
||||||
|
}
|
||||||
|
if (typeof examples === "string") {
|
||||||
|
examples = {_id : examples};
|
||||||
|
}
|
||||||
|
if (!Array.isArray(examples)) {
|
||||||
|
examples = [examples];
|
||||||
|
}
|
||||||
|
if (examples.length === 0 || (
|
||||||
|
examples.length === 1 &&
|
||||||
|
Object.keys(examples).length === 0)) {
|
||||||
return edges;
|
return edges;
|
||||||
}
|
}
|
||||||
edges.forEach(function(edge) {
|
edges.forEach(function(edge) {
|
||||||
|
@ -5364,8 +5378,7 @@ function GENERAL_GRAPH_SHORTEST_PATH (graphName,
|
||||||
options.direction = 'any';
|
options.direction = 'any';
|
||||||
}
|
}
|
||||||
|
|
||||||
options.edgeExamples = options.edgeExamples || [];
|
options.edgeExamples = options.edgeExamples || {};
|
||||||
|
|
||||||
var graph = RESOLVE_GRAPH_TO_DOCUMENTS(graphName, options);
|
var graph = RESOLVE_GRAPH_TO_DOCUMENTS(graphName, options);
|
||||||
|
|
||||||
if (!options.algorithm) {
|
if (!options.algorithm) {
|
||||||
|
@ -5850,7 +5863,7 @@ function GENERAL_GRAPH_NEIGHBORS (graphName,
|
||||||
params.minDepth = options.minDepth === undefined ? 1 : options.minDepth;
|
params.minDepth = options.minDepth === undefined ? 1 : options.minDepth;
|
||||||
params.maxDepth = options.maxDepth === undefined ? 1 : options.maxDepth;
|
params.maxDepth = options.maxDepth === undefined ? 1 : options.maxDepth;
|
||||||
params.paths = true;
|
params.paths = true;
|
||||||
options.edgeExamples = options.edgeExamples || [];
|
options.edgeExamples = options.edgeExamples || {};
|
||||||
params.visitor = TRAVERSAL_NEIGHBOR_VISITOR;
|
params.visitor = TRAVERSAL_NEIGHBOR_VISITOR;
|
||||||
|
|
||||||
var graph = RESOLVE_GRAPH_TO_DOCUMENTS(graphName, options);
|
var graph = RESOLVE_GRAPH_TO_DOCUMENTS(graphName, options);
|
||||||
|
|
Loading…
Reference in New Issue