Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
992c3ca
preview CI
rashtao Mar 19, 2020
0b4f404
Insert-Update (#336)
rashtao Mar 24, 2020
4f0a9e1
satellite graphs (#337)
rashtao Mar 24, 2020
ba7a162
schema validation (#339)
rashtao Mar 24, 2020
8e61624
added peakMemoryUsage aql stats
rashtao Mar 20, 2020
4c76631
v6.7.0_PREVIEW_3.7.0-alpha.2_0
rashtao Mar 24, 2020
597b007
Merge branch 'master' into preview
rashtao Apr 2, 2020
74c7561
renamed collection validation to schema
rashtao Apr 16, 2020
8f74095
bugfix validation error response code
rashtao Apr 17, 2020
4b507ce
Merge branch 'master' into preview
rashtao May 19, 2020
d7bf6dc
overwriteMode conflict and ignore
rashtao May 19, 2020
262568f
primarySortCompression
rashtao May 19, 2020
99c3c9a
ArangoSearchProperties storedValues
rashtao May 19, 2020
f7adff3
check db version in ArangoSearchTest
rashtao May 19, 2020
b007c94
added keepNull & mergeObjects parameters for insert-update document
rashtao May 20, 2020
b33f14f
disjoint smart graphs
rashtao May 20, 2020
489accd
docker images matrix upd
rashtao May 20, 2020
599fdd3
bugfix getAndClearSlowQueries test
rashtao May 20, 2020
15f0181
Revert "added keepNull & mergeObjects parameters for insert-update do…
rashtao May 22, 2020
9f2420c
ChangeLog.md upd
rashtao May 22, 2020
d7714a9
ChangeLog.md upd
rashtao May 22, 2020
f2f26d9
added mergeObjects parameters for insert-update document
rashtao May 22, 2020
40693f6
v6.7.0_PREVIEW_3.7.1-alpha.1
rashtao May 22, 2020
b40b24a
gh actions debug containers on tests failure
rashtao May 25, 2020
c57080b
fixed async tests
rashtao Jun 29, 2020
1285877
Merge branch 'master' into preview
rashtao Jun 30, 2020
b36e0ef
javadoc upd
rashtao Jun 30, 2020
c3bf2d5
javadoc upd
rashtao Jun 30, 2020
04578bb
test matrix upd
rashtao Jun 30, 2020
e97d2f5
Merge branch 'master' into preview
rashtao Jul 1, 2020
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
javadoc upd
  • Loading branch information
rashtao committed Jun 30, 2020
commit c3bf2d574d875ad598184fbec5dc25ae2fb59d00
8 changes: 4 additions & 4 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a

## [6.7.0_PREVIEW_3.7.1-alpha.1] - 2020-05-22

- added support of `DisjointSmartGraphs` and `SatelliteGraphs` (ArangoDB v3.7)
- added support of `storedValues` in `ArangoSearchProperties` (ArangoDB v3.7)
- added support of `primarySortCompression` in `ArangoSearchProperties` (ArangoDB v3.7)
- added support of `overwriteMode` on document creation, to allow `insert-ignore`, `insert-replace` and `insert-update` (ArangoDB v3.7)
- added support of `mergeObjects` for insert document with `overwriteMode: update` (ArangoDB v3.7)
- added support of `DisjointSmartGraphs` (ArangoDB v3.7)
- added support of `ArangoSearchProperties` value `storedValues` (ArangoDB v3.7)
- added support of `ArangoSearchProperties` value `primarySortCompression` (ArangoDB v3.7)
- added support of `overwriteMode` values `ignore` and `conflict` (ArangoDB v3.7)
- velocypack v2.3.1

## [6.6.3] - 2020-05-06
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/arangodb/entity/CollectionEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ public CollectionType getType() {
return type;
}

/**
* @return Optional object that specifies the collection level schema for documents.
* @since ArangoDB 3.7
*/
public CollectionSchema getSchema() {
return schema;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ public class VPackSerializers {
builder.close(); // close array
}


};

private static void serializeFieldLinks(final VPackBuilder builder, final Collection<FieldLink> links) {
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/arangodb/model/CollectionCreateOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,11 @@ public CollectionSchema getSchema() {
return schema;
}

/**
* @param schema object that specifies the collection level schema for documents
* @since ArangoDB 3.7
* @return options
*/
public CollectionCreateOptions setSchema(final CollectionSchema schema) {
this.schema = schema;
return this;
Expand Down
30 changes: 30 additions & 0 deletions src/main/java/com/arangodb/model/CollectionSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,17 @@

/**
* @author Michele Rastelli
* @see <a href="https://www.arangodb.com/docs/stable/data-modeling-documents-schema-validation.html">API Documentation</a>
* @since ArangoDB 3.7
*/
public class CollectionSchema {
private String rule;
private Level level;
private String message;

/**
* @return JSON Schema description
*/
public String getRule() {
return rule;
}
Expand All @@ -39,6 +44,9 @@ public CollectionSchema setRule(String rule) {
return this;
}

/**
* @return controls when the validation will be applied
*/
public Level getLevel() {
return level;
}
Expand All @@ -48,6 +56,9 @@ public CollectionSchema setLevel(Level level) {
return this;
}

/**
* @return the message that will be used when validation fails
*/
public String getMessage() {
return message;
}
Expand All @@ -58,9 +69,28 @@ public CollectionSchema setMessage(String message) {
}

public enum Level {

/**
* The rule is inactive and validation thus turned off.
*/
NONE("none"),

/**
* Only newly inserted documents are validated.
*/
NEW("new"),

/**
* New and modified documents must pass validation, except for modified documents where the OLD value did not
* pass validation already. This level is useful if you have documents which do not match your target structure,
* but you want to stop the insertion of more invalid documents and prohibit that valid documents are changed to
* invalid documents.
*/
MODERATE("moderate"),

/**
* All new and modified document must strictly pass validation. No exceptions are made (default).
*/
STRICT("strict");

private final String value;
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/com/arangodb/model/DocumentCreateOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ public OverwriteMode getOverwriteMode() {
* this option follows the rules of the overwrite parameter.
* @return options
* @since ArangoDB 3.7
*
* @implNote The current implementation has the following limitations:
* - `keepNull` parameter is not supported
* - the fields having {@code null} value are always removed during serialization
* Therefore in case of {@link OverwriteMode#update}, existing attributes cannot be removed.
*/
public DocumentCreateOptions overwriteMode(final OverwriteMode overwriteMode) {
this.overwriteMode = overwriteMode;
Expand Down Expand Up @@ -152,6 +157,8 @@ public Boolean getMergeObjects() {
* document. If set to false, the value in the patch document will overwrite the existing document's
* value. If set to true, objects will be merged. The default is true.
* @return options
* @since ArangoDB 3.7
*
* @apiNote only considered if {@link this#overwriteMode} is set to {@link OverwriteMode#update}
*/
public DocumentCreateOptions mergeObjects(Boolean mergeObjects) {
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/com/arangodb/model/GraphCreateOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ public Boolean getIsDisjoint() {
return getOptions().getIsDisjoint();
}

/**
* @param isDisjoint If set to true, a Disjoint SmartGraph will be created. This flag is not editable after
* creation. Default: false.
* @return options
* @since ArangoDB 3.7
*/
public GraphCreateOptions isDisjoint(final Boolean isDisjoint) {
getOptions().setIsDisjoint(isDisjoint);
return this;
Expand Down
25 changes: 25 additions & 0 deletions src/main/java/com/arangodb/model/OverwriteMode.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,36 @@

/**
* @author Michele Rastelli
* @since ArangoDB 3.7
*/
public enum OverwriteMode {

/**
* if a document with the specified _key value exists already, nothing will be done and no write operation will be
* carried out. The insert operation will return success in this case. This mode does not support returning the old
* document version using RETURN OLD. When using RETURN NEW, null will be returned in case the document already
* existed.
*/
ignore("ignore"),

/**
* if a document with the specified _key value exists already, it will be overwritten with the specified document
* value. This mode will also be used when no overwrite mode is specified but the overwrite flag is set to true.
*/
replace("replace"),

/**
* if a document with the specified _key value exists already, it will be patched (partially updated) with the
* specified document value. The overwrite mode can be further controlled via the keepNull and mergeObjects
* parameters.
*/
update("update"),

/**
* if a document with the specified _key value exists already, return a unique constraint violation error so that
* the insert operation fails. This is also the default behavior in case the overwrite mode is not set, and the
* overwrite flag is false or not set either.
*/
conflict("conflict");

private final String value;
Expand Down