Skip to content

Commit 8a8bc01

Browse files
author
Mark
committed
update docu
1 parent 6592d90 commit 8a8bc01

File tree

5 files changed

+27
-23
lines changed

5 files changed

+27
-23
lines changed

docs/aql.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,20 @@ E.g. get all Simpsons aged 3 or older in ascending order:
2121
Map<String, Object> bindVars = new HashMap<>();
2222
bindVars.put("age", 3);
2323

24-
ArangoCursor<MyObject> cursor = db.query(query, bindVars, null, MyObject.class);
25-
26-
cursor.forEachRemaining(obj -> {
27-
System.out.println(obj.getName());
24+
db.query(query, bindVars, null, MyObject.class).thenAccept(cursor -> {
25+
cursor.forEachRemaining(obj -> {
26+
System.out.println(obj.getName());
27+
});
2828
});
29+
2930
```
3031

3132
or return the AQL result as VelocyPack:
3233

3334
``` Java
34-
ArangoCursor<VPackSlice> cursor = db.query(query, bindVars, null, VPackSlice.class);
35-
36-
cursor.forEachRemaining(obj -> {
37-
System.out.println(obj.get("name").getAsString());
35+
db.query(query, bindVars, null, VPackSlice.class).thenAccept(cursor -> {
36+
cursor.forEachRemaining(obj -> {
37+
System.out.println(obj.get("name").getAsString());
38+
});
3839
});
3940
```

docs/basic_operations.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,28 +98,31 @@ E.g. in the previous example the object was stored as follows:
9898

9999
## read document by key (as JavaBean)
100100
``` Java
101-
MyObject document = arangoDB.db("myDatabase").collection("myCollection").getDocument(myObject.getKey, MyObject.class).get();
102-
document.getName();
103-
document.getAge();
101+
arangoDB.db("myDatabase").collection("myCollection").getDocument(myObject.getKey, MyObject.class).thenAccept(document -> {
102+
document.getName();
103+
document.getAge();
104+
});
105+
104106

105107
```
106108

107109
## read document (as VelocyPack)
108110
``` Java
109-
VPackSlice document = arangoDB.db("myDatabase").collection("myCollection").getDocument(myObject.getKey, VPackSlice.class).get();
110-
document.get("name").getAsString();
111-
document.get("age").getAsInt();
111+
arangoDB.db("myDatabase").collection("myCollection").getDocument(myObject.getKey, VPackSlice.class).thenAccept(document -> {
112+
document.get("name").getAsString();
113+
document.get("age").getAsInt();
114+
});
112115

113116
```
114117

115118
## read document (as Json)
116119
``` Java
117-
arangoDB.db("myDatabase").collection("myCollection").getDocument(myObject.getKey, String.class).get();
120+
arangoDB.db("myDatabase").collection("myCollection").getDocument(myObject.getKey, String.class);
118121

119122
```
120123

121124
## read document by id
122125
``` Java
123-
arangoDB.db("myDatabase").getDocument("myCollection/myKey", MyObject.class).get();
126+
arangoDB.db("myDatabase").getDocument("myCollection/myKey", MyObject.class);
124127

125128
```

docs/setup.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ The driver is configured with some default values:
2525
To customize the configuration the parameters can be changed in the code...
2626

2727
``` Java
28-
ArangoDB arangoDB = new ArangoDB.Builder().host("192.168.182.50").port(8888).build();
28+
ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().host("192.168.182.50").port(8888).build();
2929

3030
```
3131
... or with a custom properties file (my.properties)
3232

3333
``` Java
3434
InputStream in = MyClass.class.getResourceAsStream("my.properties");
35-
ArangoDB arangoDB = new ArangoDB.Builder().loadProperties(in).build();
35+
ArangoDBAsync arangoDB = new ArangoDBAsync.Builder().loadProperties(in).build();
3636

3737
```
3838

docs/user_management.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ If you are using [authentication] (https://docs.arangodb.com/Manual/GettingStart
1919

2020
##list users
2121
``` Java
22-
Collection<UserResult> users = arangoDB.getUsers();
23-
for(UserResult user : users) {
24-
System.out.println(user.getUser())
25-
}
22+
arangoDB.getUsers().thenAccept(users -> {
23+
for(UserResult user : users) {
24+
System.out.println(user.getUser())
25+
}
26+
});
2627
```
2728

2829
##delete user

src/test/java/com/arangodb/CommunicationTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
import java.util.concurrent.CompletableFuture;
2727

28-
import org.junit.Ignore;
2928
import org.junit.Test;
3029

3130
/**

0 commit comments

Comments
 (0)