mirror of https://gitee.com/bigwinds/arangodb
fixthedocs.com
This commit is contained in:
parent
7b5b112b88
commit
b09638a883
|
@ -136,7 +136,7 @@ You should see something like
|
||||||
|
|
||||||
@startDocuBlockInline JSON_07_fetchroutingCreateHelloEcho
|
@startDocuBlockInline JSON_07_fetchroutingCreateHelloEcho
|
||||||
@EXAMPLE_ARANGOSH_OUTPUT{JSON_07_fetchroutingCreateHelloEcho}
|
@EXAMPLE_ARANGOSH_OUTPUT{JSON_07_fetchroutingCreateHelloEcho}
|
||||||
arango.GET("/hello/echo")
|
arango.GET_RAW("/hello/echo", { "accept" : "application/json" })
|
||||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||||
@endDocuBlock JSON_07_fetchroutingCreateHelloEcho
|
@endDocuBlock JSON_07_fetchroutingCreateHelloEcho
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ Reload the routing and check http:// 127.0.0.1:8529/hello/echo:
|
||||||
|
|
||||||
@startDocuBlockInline JSON_10_fetchroutingCreateEchoController
|
@startDocuBlockInline JSON_10_fetchroutingCreateEchoController
|
||||||
@EXAMPLE_ARANGOSH_OUTPUT{JSON_10_fetchroutingCreateEchoController}
|
@EXAMPLE_ARANGOSH_OUTPUT{JSON_10_fetchroutingCreateEchoController}
|
||||||
arango.GET("/hello/echo")
|
arango.GET_RAW("/hello/echo", { "accept" : "application/json" })
|
||||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||||
@endDocuBlock JSON_10_fetchroutingCreateEchoController
|
@endDocuBlock JSON_10_fetchroutingCreateEchoController
|
||||||
|
|
||||||
|
@ -271,7 +271,7 @@ You can also store a function directly in the routing table.
|
||||||
|
|
||||||
@startDocuBlockInline JSON_12b_fetchroutingEchoFunction
|
@startDocuBlockInline JSON_12b_fetchroutingEchoFunction
|
||||||
@EXAMPLE_ARANGOSH_OUTPUT{JSON_12b_fetchroutingEchoFunction}
|
@EXAMPLE_ARANGOSH_OUTPUT{JSON_12b_fetchroutingEchoFunction}
|
||||||
arango.GET("hello/echo")
|
arango.GET_RAW("hello/echo", { "accept" : "application/json" })
|
||||||
db._query("FOR route IN _routing FILTER route.url == '/hello/echo' REMOVE route in _routing")
|
db._query("FOR route IN _routing FILTER route.url == '/hello/echo' REMOVE route in _routing")
|
||||||
require("internal").reloadRouting()
|
require("internal").reloadRouting()
|
||||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||||
|
@ -317,7 +317,7 @@ You should see something like
|
||||||
|
|
||||||
@startDocuBlockInline JSON_14_fetchroutingRequestHelloEcho
|
@startDocuBlockInline JSON_14_fetchroutingRequestHelloEcho
|
||||||
@EXAMPLE_ARANGOSH_OUTPUT{JSON_14_fetchroutingRequestHelloEcho}
|
@EXAMPLE_ARANGOSH_OUTPUT{JSON_14_fetchroutingRequestHelloEcho}
|
||||||
arango.GET("/hello/echo")
|
arango.GET_RAW("/hello/echo", { "accept" : "application/json" })
|
||||||
db._query("FOR route IN _routing FILTER route.url == '/hello/echo' REMOVE route in _routing")
|
db._query("FOR route IN _routing FILTER route.url == '/hello/echo' REMOVE route in _routing")
|
||||||
require("internal").reloadRouting()
|
require("internal").reloadRouting()
|
||||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||||
|
@ -344,7 +344,7 @@ You now see the options in the result:
|
||||||
|
|
||||||
@startDocuBlockInline JSON_16_fetchroutingEchoRequestOptions
|
@startDocuBlockInline JSON_16_fetchroutingEchoRequestOptions
|
||||||
@EXAMPLE_ARANGOSH_OUTPUT{JSON_16_fetchroutingEchoRequestOptions}
|
@EXAMPLE_ARANGOSH_OUTPUT{JSON_16_fetchroutingEchoRequestOptions}
|
||||||
arango.GET("/echo")
|
arango.GET_RAW("/echo", { accept: "application/json" })
|
||||||
db._query("FOR route IN _routing FILTER route.url == '/echo' REMOVE route in _routing")
|
db._query("FOR route IN _routing FILTER route.url == '/echo' REMOVE route in _routing")
|
||||||
require("internal").reloadRouting()
|
require("internal").reloadRouting()
|
||||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||||
|
|
|
@ -82,7 +82,7 @@ deletes a function:
|
||||||
code : "function (x) { return x*x; }"
|
code : "function (x) { return x*x; }"
|
||||||
};
|
};
|
||||||
|
|
||||||
db._connection.POST("/_api/aqlfunction", JSON.stringify(body));
|
db._connection.POST("/_api/aqlfunction", body);
|
||||||
var response = logCurlRequest('DELETE', url);
|
var response = logCurlRequest('DELETE', url);
|
||||||
|
|
||||||
assert(response.code === 200);
|
assert(response.code === 200);
|
||||||
|
|
|
@ -172,8 +172,7 @@ var runTestLine = function(line, testName, sourceFN, sourceLine, lineCount, show
|
||||||
/* jshint ignore:start */
|
/* jshint ignore:start */
|
||||||
if (!showCmd || isLoop) {
|
if (!showCmd || isLoop) {
|
||||||
eval(line);
|
eval(line);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
eval("XXX = " + line);
|
eval("XXX = " + line);
|
||||||
}
|
}
|
||||||
/* jshint ignore:end */
|
/* jshint ignore:end */
|
||||||
|
@ -185,13 +184,11 @@ var runTestLine = function(line, testName, sourceFN, sourceLine, lineCount, show
|
||||||
if (expectError !== undefined) {
|
if (expectError !== undefined) {
|
||||||
if (err.errorNum === errors[expectError].code) {
|
if (err.errorNum === errors[expectError].code) {
|
||||||
print(err);
|
print(err);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
print(err);
|
print(err);
|
||||||
createErrorMessage(err, line, testName, sourceFN, sourceLine, lineCount, " caught unexpected exception!");
|
createErrorMessage(err, line, testName, sourceFN, sourceLine, lineCount, " caught unexpected exception!");
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
createErrorMessage(err, line, testName, sourceFN, sourceLine, lineCount, " caught an exception!\n");
|
createErrorMessage(err, line, testName, sourceFN, sourceLine, lineCount, " caught an exception!\n");
|
||||||
print(err);
|
print(err);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1649,6 +1649,9 @@ void Ast::injectBindParameters(
|
||||||
TRI_ASSERT(graphNode->isStringValue());
|
TRI_ASSERT(graphNode->isStringValue());
|
||||||
std::string graphName = graphNode->getString();
|
std::string graphName = graphNode->getString();
|
||||||
auto graph = _query->lookupGraphByName(graphName);
|
auto graph = _query->lookupGraphByName(graphName);
|
||||||
|
if (graph == nullptr) {
|
||||||
|
THROW_ARANGO_EXCEPTION(TRI_ERROR_GRAPH_NOT_FOUND);
|
||||||
|
}
|
||||||
TRI_ASSERT(graph != nullptr);
|
TRI_ASSERT(graph != nullptr);
|
||||||
|
|
||||||
auto vColls = graph->vertexCollections();
|
auto vColls = graph->vertexCollections();
|
||||||
|
@ -1686,6 +1689,9 @@ void Ast::injectBindParameters(
|
||||||
TRI_ASSERT(graphNode->isStringValue());
|
TRI_ASSERT(graphNode->isStringValue());
|
||||||
std::string graphName = graphNode->getString();
|
std::string graphName = graphNode->getString();
|
||||||
auto graph = _query->lookupGraphByName(graphName);
|
auto graph = _query->lookupGraphByName(graphName);
|
||||||
|
if (graph == nullptr) {
|
||||||
|
THROW_ARANGO_EXCEPTION(TRI_ERROR_GRAPH_NOT_FOUND);
|
||||||
|
}
|
||||||
TRI_ASSERT(graph != nullptr);
|
TRI_ASSERT(graph != nullptr);
|
||||||
auto vColls = graph->vertexCollections();
|
auto vColls = graph->vertexCollections();
|
||||||
|
|
||||||
|
|
|
@ -158,13 +158,18 @@ let appendHeaders = function(appender, headers) {
|
||||||
return function (method, url, body, headers) {
|
return function (method, url, body, headers) {
|
||||||
var response;
|
var response;
|
||||||
var curl;
|
var curl;
|
||||||
var i;
|
|
||||||
var jsonBody = false;
|
var jsonBody = false;
|
||||||
|
|
||||||
if ((typeof body !== 'string') && (body !== undefined)) {
|
if ((typeof body !== 'string') && (body !== undefined)) {
|
||||||
jsonBody = true;
|
jsonBody = true;
|
||||||
body = exports.inspect(body);
|
body = exports.inspect(body);
|
||||||
}
|
}
|
||||||
|
if (headers === undefined || headers === null || headers === '') {
|
||||||
|
headers = {};
|
||||||
|
}
|
||||||
|
if (!headers.hasOwnProperty('Accept') && !headers.hasOwnProperty('accept')) {
|
||||||
|
headers['accept'] = 'application/json';
|
||||||
|
}
|
||||||
|
|
||||||
curl = 'shell> curl ';
|
curl = 'shell> curl ';
|
||||||
|
|
||||||
|
@ -185,12 +190,12 @@ let appendHeaders = function(appender, headers) {
|
||||||
} else if (method === 'HEAD') {
|
} else if (method === 'HEAD') {
|
||||||
response = exports.arango.HEAD_RAW(url, headers);
|
response = exports.arango.HEAD_RAW(url, headers);
|
||||||
curl += '-X ' + method + ' ';
|
curl += '-X ' + method + ' ';
|
||||||
} else if (method === 'OPTION') {
|
} else if (method === 'OPTION' || method === 'OPTIONS') {
|
||||||
response = exports.arango.OPTION_RAW(url, body, headers);
|
response = exports.arango.OPTION_RAW(url, body, headers);
|
||||||
curl += '-X ' + method + ' ';
|
curl += '-X ' + method + ' ';
|
||||||
}
|
}
|
||||||
if (headers !== undefined && headers !== '') {
|
if (headers !== undefined && headers !== '') {
|
||||||
for (i in headers) {
|
for (let i in headers) {
|
||||||
if (headers.hasOwnProperty(i)) {
|
if (headers.hasOwnProperty(i)) {
|
||||||
curl += "--header '" + i + ': ' + headers[i] + "' ";
|
curl += "--header '" + i + ': ' + headers[i] + "' ";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue