1
0
Fork 0

added generated files

This commit is contained in:
Jan Steemann 2015-04-27 17:44:00 +02:00
parent 5be9a0bfb6
commit 2fe04b4c5b
4 changed files with 67 additions and 69 deletions

View File

@ -157,7 +157,7 @@ exports.appendCurlRequest = function (appender) {
var curl;
var i;
if (typeof body !== 'string') {
if ((typeof body !== 'string') && (body !== undefined)) {
body = exports.inspect(body);
}
@ -204,14 +204,14 @@ exports.appendCurlRequest = function (appender) {
curl += "--dump - http://localhost:8529" + url;
appender(curl + "\n");
appender(curl);
if (body !== undefined && body !== "" && body) {
appender(body + "\n");
appender(" <<EOF\n");
appender(body);
appender("\nEOF");
}
appender("\n");
appender("\n\n");
return response;
};
};

View File

@ -177,26 +177,26 @@ ArangoCollection.prototype.toString = function () {
///
/// Use *toArray* to get all documents at once:
///
/// @EXAMPLE_ARANGOSH_OUTPUT{collectionAll}
/// @EXAMPLE_ARANGOSH_OUTPUT{001_collectionAll}
/// ~ db._create("five");
/// ~ db.five.save({ name : "one" });
/// ~ db.five.save({ name : "two" });
/// ~ db.five.save({ name : "three" });
/// ~ db.five.save({ name : "four" });
/// ~ db.five.save({ name : "five" });
/// db.five.save({ name : "one" });
/// db.five.save({ name : "two" });
/// db.five.save({ name : "three" });
/// db.five.save({ name : "four" });
/// db.five.save({ name : "five" });
/// db.five.all().toArray();
/// ~ db._drop("five");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// Use *limit* to restrict the documents:
///
/// @EXAMPLE_ARANGOSH_OUTPUT{collectionAllNext}
/// @EXAMPLE_ARANGOSH_OUTPUT{002_collectionAllNext}
/// ~ db._create("five");
/// ~ db.five.save({ name : "one" });
/// ~ db.five.save({ name : "two" });
/// ~ db.five.save({ name : "three" });
/// ~ db.five.save({ name : "four" });
/// ~ db.five.save({ name : "five" });
/// db.five.save({ name : "one" });
/// db.five.save({ name : "two" });
/// db.five.save({ name : "three" });
/// db.five.save({ name : "four" });
/// db.five.save({ name : "five" });
/// db.five.all().limit(2).toArray();
/// ~ db._drop("five");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
@ -257,11 +257,11 @@ ArangoCollection.prototype.all = function () {
///
/// Use *toArray* to get all documents at once:
///
/// @EXAMPLE_ARANGOSH_OUTPUT{collectionByExample}
/// @EXAMPLE_ARANGOSH_OUTPUT{003_collectionByExample}
/// ~ db._create("users");
/// ~ db.users.save({ name: "Gerhard" });
/// ~ db.users.save({ name: "Helmut" });
/// ~ db.users.save({ name: "Angela" });
/// db.users.save({ name: "Gerhard" });
/// db.users.save({ name: "Helmut" });
/// db.users.save({ name: "Angela" });
/// db.users.all().toArray();
/// db.users.byExample({ "_id" : "users/20" }).toArray();
/// db.users.byExample({ "name" : "Gerhard" }).toArray();
@ -271,11 +271,11 @@ ArangoCollection.prototype.all = function () {
///
/// Use *next* to loop over all documents:
///
/// @EXAMPLE_ARANGOSH_OUTPUT{collectionByExampleNext}
/// @EXAMPLE_ARANGOSH_OUTPUT{004_collectionByExampleNext}
/// ~ db._create("users");
/// ~ db.users.save({ name: "Gerhard" });
/// ~ db.users.save({ name: "Helmut" });
/// ~ db.users.save({ name: "Angela" });
/// db.users.save({ name: "Gerhard" });
/// db.users.save({ name: "Helmut" });
/// db.users.save({ name: "Angela" });
/// var a = db.users.byExample( {"name" : "Angela" } );
/// while (a.hasNext()) print(a.next());
/// ~ db._drop("users");
@ -447,12 +447,12 @@ ArangoCollection.prototype.byConditionSkiplist = function (index, condition) {
///
/// Use *toArray* to get all documents at once:
///
/// @EXAMPLE_ARANGOSH_OUTPUT{collectionRange}
/// @EXAMPLE_ARANGOSH_OUTPUT{005_collectionRange}
/// ~ db._create("old");
/// ~ db.old.ensureSkiplist("age");
/// ~ db.old.save({ age: 15 });
/// ~ db.old.save({ age: 25 });
/// ~ db.old.save({ age: 30 });
/// db.old.ensureSkiplist("age");
/// db.old.save({ age: 15 });
/// db.old.save({ age: 25 });
/// db.old.save({ age: 30 });
/// db.old.range("age", 10, 30).toArray();
/// ~ db._drop("old")
/// @END_EXAMPLE_ARANGOSH_OUTPUT
@ -483,12 +483,12 @@ ArangoCollection.prototype.range = function (name, left, right) {
///
/// Use *toArray* to get all documents at once:
///
/// @EXAMPLE_ARANGOSH_OUTPUT{collectionClosedRange}
/// @EXAMPLE_ARANGOSH_OUTPUT{006_collectionClosedRange}
/// ~ db._create("old");
/// ~ db.old.ensureSkiplist("age");
/// ~ db.old.save({ age: 15 });
/// ~ db.old.save({ age: 25 });
/// ~ db.old.save({ age: 30 });
/// db.old.ensureSkiplist("age");
/// db.old.save({ age: 15 });
/// db.old.save({ age: 25 });
/// db.old.save({ age: 30 });
/// db.old.closedRange("age", 10, 30).toArray();
/// ~ db._drop("old")
/// @END_EXAMPLE_ARANGOSH_OUTPUT
@ -681,19 +681,23 @@ ArangoCollection.prototype.geo = function(loc, order) {
///
/// To get the nearst two locations:
///
/// @EXAMPLE_ARANGOSH_OUTPUT{collectionNear}
/// @EXAMPLE_ARANGOSH_OUTPUT{007_collectionNear}
/// ~ db._create("geo");
/// db.geo.ensureGeoIndex("loc");
/// for (var i = -90; i <= 90; i += 10) { for (var j = -180; j <= 180; j += 10) { db.geo.save({ name : "Name/" + i + "/" + j, loc: [ i, j ] }); } }
/// db.geo.near(0,0).limit(2).toArray();
/// ~ db._drop("geo");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// If you need the distance as well, then you can use the *distance*
/// operator:
///
/// @EXAMPLE_ARANGOSH_OUTPUT{collectionNearDistance}
/// ~ db._drop("geo");
/// @EXAMPLE_ARANGOSH_OUTPUT{008_collectionNearDistance}
/// ~ db._create("geo");
/// ~ db.geo.ensureGeoIndex("loc");
/// ~ for (var i = -90; i <= 90; i += 10) { for (var j = -180; j <= 180; j += 10) { db.geo.save({ name : "Name/" + i + "/" + j, loc: [ i, j ] }); } }
/// db.geo.ensureGeoIndex("loc");
/// for (var i = -90; i <= 90; i += 10) { for (var j = -180; j <= 180; j += 10) { db.geo.save({ name : "Name/" + i + "/" + j, loc: [ i, j ] }); } }
/// db.geo.near(0, 0).distance().limit(2).toArray();
/// ~ db._drop("geo");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// @endDocuBlock
@ -731,12 +735,12 @@ ArangoCollection.prototype.near = function (lat, lon) {
///
/// To find all documents within a radius of 2000 km use:
///
/// @EXAMPLE_ARANGOSH_OUTPUT{collectionWithin}
/// ~ db._drop("geo");
/// @EXAMPLE_ARANGOSH_OUTPUT{009_collectionWithin}
/// ~ db._create("geo");
/// ~ db.geo.ensureGeoIndex("loc");
/// ~ for (var i = -90; i <= 90; i += 10) { for (var j = -180; j <= 180; j += 10) { db.geo.save({ name : "Name/" + i + "/" + j, loc: [ i, j ] }); } }
/// db.geo.within(0, 0, 2000 * 1000).distance().toArray();
/// ~ db._drop("geo");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// @endDocuBlock
@ -920,7 +924,7 @@ ArangoCollection.prototype.iterate = function (iterator, options) {
///
/// @EXAMPLES
///
/// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionRemoveByExample}
/// @EXAMPLE_ARANGOSH_OUTPUT{010_documentsCollectionRemoveByExample}
/// ~ db._create("example");
/// ~ db.example.save({ Hello : "world" });
/// db.example.removeByExample( {Hello : "world"} );
@ -965,9 +969,9 @@ ArangoCollection.prototype.removeByExample = function (example, waitForSync, lim
///
/// @EXAMPLES
///
/// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionReplaceByExample}
/// @EXAMPLE_ARANGOSH_OUTPUT{011_documentsCollectionReplaceByExample}
/// ~ db._create("example");
/// ~ db.example.save({ Hello : "world" });
/// db.example.save({ Hello : "world" });
/// db.example.replaceByExample({ Hello: "world" }, {Hello: "mars"}, false, 5);
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
@ -1017,10 +1021,10 @@ ArangoCollection.prototype.replaceByExample = function (example, newValue, waitF
///
/// @EXAMPLES
///
/// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionUpdateByExample}
/// @EXAMPLE_ARANGOSH_OUTPUT{012_documentsCollectionUpdateByExample}
/// ~ db._create("example");
/// ~ db.example.save({ Hello : "world" });
/// db.example.updateByExample({ Hello: "world" }, { Hello: "foo", Hello: "bar" }, false);
/// db.example.save({ Hello : "world" });
/// db.example.updateByExample({ Hello: "world" }, { Hello: "foo", World: "bar" }, false);
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
/// @endDocuBlock

View File

@ -1022,7 +1022,7 @@ AQLGenerator.prototype._getLastRestrictableStatementInfo = function() {
/// var examples = require("org/arangodb/graph-examples/example-graph.js");
/// var graph = examples.loadGraph("social");
/// var query = graph._vertices({name: "Alice"});
/// query.edges().vertices().restrict(["female", "male", "products"]).toArray();
/// query.edges().vertices().restrict(["female", "male", "products"]).toArray(); // xpError(ERROR_BAD_PARAMETER);
/// @END_EXAMPLE_ARANGOSH_OUTPUT
/// @endDocuBlock
///
@ -2195,7 +2195,10 @@ var updateBindCollections = function(graph) {
/// @EXAMPLE_ARANGOSH_OUTPUT{generalGraphEdgeCollectionSave2}
/// var examples = require("org/arangodb/graph-examples/example-graph.js");
/// var graph = examples.loadGraph("social");
/// graph.relation.save("relation/aliceAndBob", "female/alice", {type: "married", _key: "bobAndAlice"});
/// | graph.relation.save(
/// | "relation/aliceAndBob",
/// | "female/alice",
/// {type: "married", _key: "bobAndAlice"}); // xpError(ERROR_GRAPH_INVALID_EDGE)
/// @END_EXAMPLE_ARANGOSH_OUTPUT
/// @endDocuBlock
///
@ -2928,7 +2931,6 @@ Graph.prototype._neighbors = function(vertexExample, options) {
/// A route planner example, all common neighbors of capitals.
///
/// @EXAMPLE_ARANGOSH_OUTPUT{generalGraphModuleCommonNeighbors1}
/// ~ var db = require("internal").db;
/// var examples = require("org/arangodb/graph-examples/example-graph.js");
/// var graph = examples.loadGraph("routeplanner");
/// graph._commonNeighbors({isCapital : true}, {isCapital : true});
@ -2938,7 +2940,6 @@ Graph.prototype._neighbors = function(vertexExample, options) {
/// which have a maximal depth of 2 :
///
/// @EXAMPLE_ARANGOSH_OUTPUT{generalGraphModuleCommonNeighbors2}
/// ~ var db = require("internal").db;
/// var examples = require("org/arangodb/graph-examples/example-graph.js");
/// var graph = examples.loadGraph("routeplanner");
/// | graph._commonNeighbors(
@ -2987,7 +2988,6 @@ Graph.prototype._commonNeighbors = function(vertex1Example, vertex2Example, opti
/// A route planner example, all common neighbors of capitals.
///
/// @EXAMPLE_ARANGOSH_OUTPUT{generalGraphModuleCommonNeighborsAmount1}
/// ~ var db = require("internal").db;
/// var examples = require("org/arangodb/graph-examples/example-graph.js");
/// var graph = examples.loadGraph("routeplanner");
/// graph._countCommonNeighbors({isCapital : true}, {isCapital : true});
@ -2997,7 +2997,6 @@ Graph.prototype._commonNeighbors = function(vertex1Example, vertex2Example, opti
/// which have a maximal depth of 2 :
///
/// @EXAMPLE_ARANGOSH_OUTPUT{generalGraphModuleCommonNeighborsAmount2}
/// ~ var db = require("internal").db;
/// var examples = require("org/arangodb/graph-examples/example-graph.js");
/// var graph = examples.loadGraph("routeplanner");
/// | graph._countCommonNeighbors('germanCity/Hamburg', {}, {direction : 'outbound', maxDepth : 2},
@ -3078,7 +3077,6 @@ Graph.prototype._countCommonNeighbors = function(vertex1Example, vertex2Example,
/// A route planner example, all locations with the same properties:
///
/// @EXAMPLE_ARANGOSH_OUTPUT{generalGraphModuleProperties1}
/// ~ var db = require("internal").db;
/// var examples = require("org/arangodb/graph-examples/example-graph.js");
/// var graph = examples.loadGraph("routeplanner");
/// graph._commonProperties({}, {});
@ -3087,7 +3085,6 @@ Graph.prototype._countCommonNeighbors = function(vertex1Example, vertex2Example,
/// A route planner example, all cities which share same properties except for population.
///
/// @EXAMPLE_ARANGOSH_OUTPUT{generalGraphModuleProperties2}
/// ~ var db = require("internal").db;
/// var examples = require("org/arangodb/graph-examples/example-graph.js");
/// var graph = examples.loadGraph("routeplanner");
/// graph._commonProperties({}, {}, {ignoreProperties: 'population'});
@ -3132,7 +3129,6 @@ Graph.prototype._commonProperties = function(vertex1Example, vertex2Example, opt
/// A route planner example, all locations with the same properties:
///
/// @EXAMPLE_ARANGOSH_OUTPUT{generalGraphModuleAmountProperties1}
/// ~ var db = require("internal").db;
/// var examples = require("org/arangodb/graph-examples/example-graph.js");
/// var graph = examples.loadGraph("routeplanner");
/// graph._countCommonProperties({}, {});
@ -3141,7 +3137,6 @@ Graph.prototype._commonProperties = function(vertex1Example, vertex2Example, opt
/// A route planner example, all German cities which share same properties except for population.
///
/// @EXAMPLE_ARANGOSH_OUTPUT{generalGraphModuleAmountProperties2}
/// ~ var db = require("internal").db;
/// var examples = require("org/arangodb/graph-examples/example-graph.js");
/// var graph = examples.loadGraph("routeplanner");
/// | graph._countCommonProperties({}, {}, {vertex1CollectionRestriction : 'germanCity',
@ -3207,7 +3202,6 @@ Graph.prototype._countCommonProperties = function(vertex1Example, vertex2Example
/// Return all paths of the graph "social":
///
/// @EXAMPLE_ARANGOSH_OUTPUT{generalGraphModulePaths}
/// ~ var db = require("internal").db;
/// var examples = require("org/arangodb/graph-examples/example-graph.js");
/// var g = examples.loadGraph("social");
/// g._paths();
@ -3217,7 +3211,6 @@ Graph.prototype._countCommonProperties = function(vertex1Example, vertex2Example
/// length of 1 and a minimal length of 2:
///
/// @EXAMPLE_ARANGOSH_OUTPUT{generalGraphModulePaths2}
/// ~ var db = require("internal").db;
/// var examples = require("org/arangodb/graph-examples/example-graph.js");
/// var g = examples.loadGraph("social");
/// g._paths({direction : 'inbound', minLength : 1, maxLength : 2});
@ -3304,7 +3297,6 @@ Graph.prototype._paths = function(options) {
/// A route planner example, shortest path from all german to all french cities:
///
/// @EXAMPLE_ARANGOSH_OUTPUT{generalGraphModuleShortestPaths1}
/// ~ var db = require("internal").db;
/// var examples = require("org/arangodb/graph-examples/example-graph.js");
/// var g = examples.loadGraph("routeplanner");
/// | g._shortestPath({}, {}, {weight : 'distance', endVertexCollectionRestriction : 'frenchCity',
@ -3314,7 +3306,6 @@ Graph.prototype._paths = function(options) {
/// A route planner example, shortest path from Hamburg and Cologne to Lyon:
///
/// @EXAMPLE_ARANGOSH_OUTPUT{generalGraphModuleShortestPaths2}
/// ~ var db = require("internal").db;
/// var examples = require("org/arangodb/graph-examples/example-graph.js");
/// var g = examples.loadGraph("routeplanner");
/// | g._shortestPath([{_id: 'germanCity/Cologne'},{_id: 'germanCity/Munich'}], 'frenchCity/Lyon',
@ -3359,7 +3350,6 @@ Graph.prototype._shortestPath = function(startVertexExample, endVertexExample, o
/// A route planner example, shortest distance from all german to all french cities:
///
/// @EXAMPLE_ARANGOSH_OUTPUT{generalGraphModuleDistanceTo1}
/// ~ var db = require("internal").db;
/// var examples = require("org/arangodb/graph-examples/example-graph.js");
/// var g = examples.loadGraph("routeplanner");
/// | g._distanceTo({}, {}, {weight : 'distance', endVertexCollectionRestriction : 'frenchCity',
@ -3369,7 +3359,6 @@ Graph.prototype._shortestPath = function(startVertexExample, endVertexExample, o
/// A route planner example, shortest distance from Hamburg and Cologne to Lyon:
///
/// @EXAMPLE_ARANGOSH_OUTPUT{generalGraphModuleDistanceTo2}
/// ~ var db = require("internal").db;
/// var examples = require("org/arangodb/graph-examples/example-graph.js");
/// var g = examples.loadGraph("routeplanner");
/// | g._distanceTo([{_id: 'germanCity/Cologne'},{_id: 'germanCity/Munich'}], 'frenchCity/Lyon',

View File

@ -363,12 +363,17 @@ Edge.prototype.getOutVertex = function () {
/// @EXAMPLES
///
/// @EXAMPLE_ARANGOSH_OUTPUT{edgeGetPeerVertex}
/// ~ db._create("example");
/// v1 = example.addVertex("1");
/// ~ db._drop("v");
/// ~ db._drop("e");
/// Graph = require("org/arangodb/graph-blueprint").Graph;
/// g = new Graph("example", "v", "e");
/// v1 = g.addVertex("1");
/// v2 = g.addVertex("2");
/// e = g.addEdge(v1, v2, "1->2", "knows");
/// e = g.addEdge(v1, v2, "1-to-2", "knows");
/// e.getPeerVertex(v1);
/// ~ db._drop("example");
/// ~ Graph.drop("example");
/// ~ db._drop("v");
/// ~ db._drop("e");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////