8000 Merge branch 'cursor-refactoring' of https://github.com/arangodb/aran… · cloud-coders/arangodb@e2a0fd8 · GitHub
[go: up one dir, main page]

Skip to content

Commit e2a0fd8

Browse files
author
Jan Steemann
committed
Merge branch 'cursor-refactoring' of https://github.com/arangodb/arangodb into devel
2 parents 12aadb0 + 1e4ad22 commit e2a0fd8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+3518
-1936
lines changed

Documentation/Books/Users/HttpAqlQueryCursor/README.mdpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
This is an introduction to ArangoDB's HTTP Interface for Queries. Results of AQL
66
and simple queries are returned as cursors in order to batch the communication
77
between server and client. Each call returns a number of documents in a batch
8-
and an indication, if the current batch has been the final batch. Depending on
8+
and an indication if the current batch has been the final batch. Depending on
99
the query, the total number of documents in the result set might or might not be
1010
known in advance. In order to free server resources the client should delete the
1111
cursor as soon as it is no longer needed.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
!CHAPTER HTTP Interface for Exporting Documents
2+
3+
@startDocuBlock JSF_post_api_export

Documentation/Books/Users/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@
164164
* [Edges](HttpEdge/README.md)
165165
* [Address and ETag](HttpEdge/AddressAndEtag.md)
166166
* [Working with Edges](HttpEdge/WorkingWithEdges.md)
167+
* [Exporting data](HttpExport/README.md)
167168
* [AQL Query Cursors](HttpAqlQueryCursor/README.md)
168169
* [Query Results](HttpAqlQueryCursor/QueryResults.md)
169170
* [Accessing Cursors](HttpAqlQueryCursor/AccessingCursors.md)

Documentation/Scripts/generateSwaggerApi.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,12 @@
4444
files = {
4545
"js/actions/api-aqlfunction.js" : "aqlfunction",
4646
"arangod/RestHandler/RestBatchHandler.cpp" : "batch",
47-
"js/actions/api-collection.js" : "collection",
48-
"js/actions/api-cursor.js" : "cursor",
49-
"js/actions/api-database.js" : "database",
47+
"js/actions/_api/collection/app.js" : "collection",
48+
"js/actions/_admin/database/app.js" : "database",
49+
"arangod/RestHandler/RestCursorHandler.cpp" : "cursor",
5050
"arangod/RestHandler/RestDocumentHandler.cpp" : "document",
5151
"arangod/RestHandler/RestEdgeHandler.cpp" : "edge",
52+
"arangod/RestHandler/RestExportHandler.cpp" : "export",
5253
"js/actions/api-edges.js" : "edges",
5354
"js/actions/api-endpoint.js" : "endpoint",
5455
"js/actions/api-explain.js" : "explain",
@@ -57,16 +58,17 @@
5758
"js/actions/api-index.js" : "index",
5859
"lib/HttpServer/AsyncJobManager.h" : "job",
5960
"lib/Admin/RestAdminLogHandler.cpp" : "log",
60-
"js/actions/api-query.js" : "query",
61+
"arangod/RestHandler/RestQueryHandler.cpp" : "query",
6162
"arangod/RestHandler/RestReplicationHandler.cpp" : "replication",
6263
"js/actions/api-simple.js" : "simple",
6364
"js/actions/api-structure.js" : "structure",
6465
"js/actions/api-system.js" : "system",
6566
"js/actions/api-tasks.js" : "tasks",
6667
"js/actions/api-transaction.js" : "transaction",
6768
"js/actions/api-traversal.js" : "traversal",
68-
"js/actions/api-user.js" : "user",
69-
"lib/Admin/RestVersionHandler.cpp" : "version"
69+
"js/actions/_api/user/app.js" : "user",
70+
"lib/Admin/RestVersionHandler.cpp" : "version",
71+
"js/actions/_admin/wal/app.js" : "wal"
7072
}
7173

7274
if len(sys.argv) < 3:

UnitTests/HttpInterface/api-cursor-spec.rb

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
doc.headers['content-type'].should eq("application/json; charset=utf-8")
2626
doc.parsed_response['error'].should eq(true)
2727
doc.parsed_response['code'].should eq(400)
28-
doc.parsed_response['errorNum'].should eq(1502)
28+
doc.parsed_response['errorNum'].should eq(600)
2929
end
3030

3131
it "returns an error if collection is unknown" do
@@ -416,6 +416,62 @@
416416
doc.parsed_response['count'].should eq(5)
417417
doc.parsed_response['result'].length.should eq(1)
418418
end
419+
420+
it "creates a query that executes a v8 expression during query optimization" do
421+
cmd = api
422+
body = "{ \"query\" : \"RETURN CONCAT('foo', 'bar', 'baz')\" }"
423+
doc = ArangoDB.log_post("#{prefix}-create-v8", cmd, :body => body)
424+
425+
doc.code.should eq(201)
426+
doc.headers['content-type'].should eq("application/json; charset=utf-8")
427+
doc.parsed_response['error'].should eq(false)
428+
doc.parsed_response['code'].should eq(201)
429+
doc.parsed_response['id'].should be_nil
430+
doc.parsed_response['hasMore'].should eq(false)
431+
doc.parsed_response['result'].length.should eq(1)
432+
end
433+
434+
it "creates a query that executes a v8 expression during query execution" do
435+
cmd = api
436+
body = "{ \"query\" : \"FOR u IN #{@cn} RETURN PASSTHRU(KEEP(u, '_key'))\" }"
437+
doc = ArangoDB.log_post("#{prefix}-create-v8", cmd, :body => body)
438+
439+
doc.code.should eq(201)
440+
doc.headers['content-type'].should eq("application/json; charset=utf-8")
441+
doc.parsed_response['error'].should eq(false)
442+
doc.parsed_response['code'].should eq(201)
443+
doc.parsed_response['id'].should be_nil
444+
doc.parsed_response['hasMore'].should eq(false)
445+
doc.parsed_response['result'].length.should eq(10)
446+
end
447+
448+
it "creates a query that executes a dynamic index expression during query execution" do
449+
cmd = api
450+
body = "{ \"query\" : \"FOR i IN #{@cn} FOR j IN #{@cn} FILTER i._key == j._key RETURN i._key\" }"
451+
doc = ArangoDB.log_post("#{prefix}-index-expression", cmd, :body => body)
452+
453+
doc.code.should eq(201)
454+
doc.headers['content-type'].should eq("application/json; charset=utf-8")
455+
doc.parsed_response['error'].should eq(false)
456+
doc.parsed_response['code'].should eq(201)
457+
doc.parsed_response['id'].should be_nil
458+
doc.parsed_response['hasMore'].should eq(false)
459+
doc.parsed_response['result'].length.should eq(10)
460+
end
461+
462+
it "creates a query that executes a dynamic V8 index expression during query execution" do
463+
cmd = api
464+
body = "{ \"query\" : \"FOR i IN #{@cn} FOR j IN #{@cn} FILTER j._key == PASSTHRU(i._key) RETURN i._key\" }"
465+
doc = ArangoDB.log_post("#{prefix}-v8-index-expression", cmd, :body => body)
466+
467+
doc.code.should eq(201)
468+
doc.headers['content-type'].should eq("application/json; charset=utf-8")
469+
doc.parsed_response['error'].should eq(false)
470+
doc.parsed_response['code'].should eq(201)
471+
doc.parsed_response['id'].should be_nil
472+
doc.parsed_response['hasMore'].should eq(false)
473+
doc.parsed_response['result'].length.should eq(10)
474+
end
419475
end
420476

421477
################################################################################

0 commit comments

Comments
 (0)
0