diff --git a/arangodb-net-standard/DocumentApi/Models/DeleteDocumentQuery.cs b/arangodb-net-standard/DocumentApi/Models/DeleteDocumentQuery.cs index a1d07a5b..63672288 100644 --- a/arangodb-net-standard/DocumentApi/Models/DeleteDocumentQuery.cs +++ b/arangodb-net-standard/DocumentApi/Models/DeleteDocumentQuery.cs @@ -27,6 +27,13 @@ public class DeleteDocumentQuery /// public bool? Silent { get; set; } + /// + /// Whether to delete an existing entry from the in-memory + /// edge cache and refill it with another edge if an edge + /// document is removed. + /// + public bool? RefillIndexCaches { get; set; } + internal string ToQueryString() { var queryParams = new List(); @@ -42,6 +49,10 @@ internal string ToQueryString() { queryParams.Add("silent=" + Silent.ToString().ToLower()); } + if (RefillIndexCaches != null) + { + queryParams.Add("refillIndexCaches=" + RefillIndexCaches.ToString().ToLower()); + } return string.Join("&", queryParams); } } diff --git a/arangodb-net-standard/DocumentApi/Models/DeleteDocumentsQuery.cs b/arangodb-net-standard/DocumentApi/Models/DeleteDocumentsQuery.cs index 58634c94..2a002acb 100644 --- a/arangodb-net-standard/DocumentApi/Models/DeleteDocumentsQuery.cs +++ b/arangodb-net-standard/DocumentApi/Models/DeleteDocumentsQuery.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System.Collections; +using System.Collections.Generic; namespace ArangoDBNetStandard.DocumentApi.Models { @@ -31,6 +32,13 @@ public class DeleteDocumentsQuery /// public bool? Silent { get; set; } + /// + /// Whether to delete an existing entry from the in-memory + /// edge cache and refill it with another edge if an edge + /// document is removed. + /// + public bool? RefillIndexCaches { get; set; } + internal string ToQueryString() { var queryParams = new List(); @@ -50,6 +58,10 @@ internal string ToQueryString() { queryParams.Add("silent=" + Silent.ToString().ToLower()); } + if (RefillIndexCaches != null) + { + queryParams.Add("refillIndexCaches=" + RefillIndexCaches.ToString().ToLower()); + } return string.Join("&", queryParams); } } diff --git a/arangodb-net-standard/DocumentApi/Models/OverwriteModes.cs b/arangodb-net-standard/DocumentApi/Models/OverwriteModes.cs new file mode 100644 index 00000000..a871a976 --- /dev/null +++ b/arangodb-net-standard/DocumentApi/Models/OverwriteModes.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ArangoDBNetStandard.DocumentApi.Models +{ + /// + /// Defines values for document overwrite modes + /// Possible value for + /// + public static class OverwriteModes + { + /// + /// If a document with the specified _key value exists already, + /// nothing is done and no write operation is carried out. + /// The insert operation returns success in this case. + /// This mode does not support returning the old document + /// version using . + /// When using , null + /// is returned in case the document already existed. + /// + public const string Ignore = "ignore"; + + /// + /// If a document with the specified _key value exists + /// already, it is overwritten with the specified document + /// value. This mode is also used when no overwrite mode + /// is specified but the + /// flag is set to true. + /// + public const string Replace = "replace"; + + /// + /// If a document with the specified _key value exists + /// already, it is patched (partially updated) with the + /// specified document value. The overwrite mode can be + /// further controlled via the + /// and + /// + /// parameters. + /// + public const string 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 + /// flag is false or not set either. + /// + public const string Conflict = "conflict"; + } +} \ No newline at end of file diff --git a/arangodb-net-standard/DocumentApi/Models/PatchDocumentQuery.cs b/arangodb-net-standard/DocumentApi/Models/PatchDocumentQuery.cs index 20407b32..a5dfba1e 100644 --- a/arangodb-net-standard/DocumentApi/Models/PatchDocumentQuery.cs +++ b/arangodb-net-standard/DocumentApi/Models/PatchDocumentQuery.cs @@ -2,22 +2,67 @@ namespace ArangoDBNetStandard.DocumentApi.Models { + /// + /// Represents query parameters used when updating a document. + /// public class PatchDocumentQuery { + /// + /// If the intention is to delete existing attributes with the patch command, + /// this query parameter can be used with a value of false. + /// This will modify the behavior of the patch command to remove any attributes + /// from the existing document that are contained in the patch document with an attribute value of null. + /// public bool? KeepNull { get; set; } + /// + /// Controls whether objects (not arrays) will be merged + /// if present in both the existing and the patch 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. + /// public bool? MergeObjects { get; set; } + /// + /// Wait until the new documents have been synced to disk. + /// public bool? WaitForSync { get; set; } + /// + /// By default, or if this is set to true, the _rev attributes + /// in the given documents are ignored. + /// If this is set to false, then any _rev attribute given + /// in a body document is taken as a precondition. + /// The document is only updated if the current revision is the one specified. + /// public bool? IgnoreRevs { get; set; } + /// + /// Return additionally the complete previous revision + /// of the changed documents in the result. + /// public bool? ReturnOld { get; set; } + /// + /// Return additionally the complete new documents in the result. + /// public bool? ReturnNew { get; set; } + /// + /// If set to true, an empty object will be returned as response. + /// No meta-data will be returned for the created document. + /// This option can be used to save some network traffic. + /// public bool? Silent { get; set; } + /// + /// Whether to update an existing entry in the in-memory edge + /// cache if an edge document is updated. + /// + public bool? RefillIndexCaches { get; set; } + internal string ToQueryString() { var queryParams = new List(); @@ -49,6 +94,10 @@ internal string ToQueryString() { queryParams.Add("ignoreRevs=" + IgnoreRevs.ToString().ToLower()); } + if (RefillIndexCaches != null) + { + queryParams.Add("refillIndexCaches=" + RefillIndexCaches.ToString().ToLower()); + } return string.Join("&", queryParams); } } diff --git a/arangodb-net-standard/DocumentApi/Models/PatchDocumentsQuery.cs b/arangodb-net-standard/DocumentApi/Models/PatchDocumentsQuery.cs index 66cdc960..a68b87cb 100644 --- a/arangodb-net-standard/DocumentApi/Models/PatchDocumentsQuery.cs +++ b/arangodb-net-standard/DocumentApi/Models/PatchDocumentsQuery.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System.Collections; +using System.Collections.Generic; namespace ArangoDBNetStandard.DocumentApi.Models { @@ -57,6 +58,12 @@ public class PatchDocumentsQuery /// public bool? Silent { get; set; } + /// + /// Whether to update an existing entry in the in-memory edge + /// cache if an edge document is updated. + /// + public bool? RefillIndexCaches { get; set; } + internal string ToQueryString() { var queryParams = new List(); @@ -88,6 +95,10 @@ internal string ToQueryString() { queryParams.Add("silent=" + Silent.ToString().ToLower()); } + if (RefillIndexCaches != null) + { + queryParams.Add("refillIndexCaches=" + RefillIndexCaches.ToString().ToLower()); + } return string.Join("&", queryParams); } } diff --git a/arangodb-net-standard/DocumentApi/Models/PostDocumentsQuery.cs b/arangodb-net-standard/DocumentApi/Models/PostDocumentsQuery.cs index cf11d4e5..ec651795 100644 --- a/arangodb-net-standard/DocumentApi/Models/PostDocumentsQuery.cs +++ b/arangodb-net-standard/DocumentApi/Models/PostDocumentsQuery.cs @@ -8,6 +8,9 @@ namespace ArangoDBNetStandard.DocumentApi.Models /// public class PostDocumentsQuery { + /// + /// Wait until document has been synced to disk. + /// public bool? WaitForSync { get; set; } /// @@ -28,10 +31,47 @@ public class PostDocumentsQuery public bool? Silent { get; set; } /// - /// If a document already exists, whether to overwrite (replace) the document rather than respond with error. + /// If a document already exists, whether to overwrite (replace) + /// the document rather than respond with error. /// public bool? Overwrite { get; set; } + /// + /// This option supersedes and offers + /// the several modes listed in . + /// + public string OverwriteMode { get; set; } + + /// + /// If the intention is to delete existing attributes + /// with the update-insert command, the URL query + /// parameter keepNull can be used with a value of + /// false. This modifies the behavior of the patch + /// command to remove any attributes from the + /// existing document that are contained in the patch + /// document with an attribute value of null. + /// This option controls the update-insert behavior only. + /// + public bool? KeepNull { get; set; } + + /// + /// Controls whether objects (not arrays) are + /// merged if present in both, the existing and + /// the update-insert document. If set to false, + /// the value in the patch document overwrites + /// the existing document’s value. If set to true, + /// objects are merged. The default is true. + /// This option controls the update-insert + /// behavior only. + /// + public bool? MergeObjects { get; set; } + + /// + /// Whether to add a new entry to the in-memory + /// edge cache if an edge document is inserted. + /// + public bool? RefillIndexCaches { get; set; } + /// /// Get the set of options in a format suited to a URL query string. /// @@ -59,6 +99,22 @@ internal string ToQueryString() { query.Add("overwrite=" + Overwrite.ToString().ToLower()); } + if (OverwriteMode != null) + { + query.Add("overwriteMode =" + OverwriteMode.ToLower()); + } + if (KeepNull != null) + { + query.Add("keepNull=" + KeepNull.ToString().ToLower()); + } + if (MergeObjects != null) + { + query.Add("mergeObjects=" + MergeObjects.ToString().ToLower()); + } + if (RefillIndexCaches != null) + { + query.Add("refillIndexCaches=" + RefillIndexCaches.ToString().ToLower()); + } return string.Join("&", query); } } diff --git a/arangodb-net-standard/DocumentApi/Models/PutDocumentQuery.cs b/arangodb-net-standard/DocumentApi/Models/PutDocumentQuery.cs index e1771531..da85ee6d 100644 --- a/arangodb-net-standard/DocumentApi/Models/PutDocumentQuery.cs +++ b/arangodb-net-standard/DocumentApi/Models/PutDocumentQuery.cs @@ -42,6 +42,12 @@ public class PutDocumentQuery /// public bool? Silent { get; set; } + /// + /// Whether to update an existing entry in the in-memory + /// edge cache if an edge document is replaced. + /// + public bool? RefillIndexCaches { get; set; } + /// /// Get the set of options in a format suited to a URL query string. /// @@ -69,6 +75,10 @@ internal string ToQueryString() { query.Add("silent=" + Silent.ToString().ToLower()); } + if (RefillIndexCaches != null) + { + query.Add("refillIndexCaches=" + RefillIndexCaches.ToString().ToLower()); + } return string.Join("&", query); } } diff --git a/arangodb-net-standard/DocumentApi/Models/PutDocumentsQuery.cs b/arangodb-net-standard/DocumentApi/Models/PutDocumentsQuery.cs index fd9fefe8..ba930106 100644 --- a/arangodb-net-standard/DocumentApi/Models/PutDocumentsQuery.cs +++ b/arangodb-net-standard/DocumentApi/Models/PutDocumentsQuery.cs @@ -43,6 +43,12 @@ public class PutDocumentsQuery /// public bool? Silent { get; set; } + /// + /// Whether to update an existing entry in the in-memory + /// edge cache if an edge document is replaced. + /// + public bool? RefillIndexCaches { get; set; } + /// /// Get the set of options in a format suited to a URL query string. /// @@ -70,6 +76,10 @@ internal string ToQueryString() { query.Add("silent=" + Silent.ToString().ToLower()); } + if (RefillIndexCaches != null) + { + query.Add("refillIndexCaches=" + RefillIndexCaches.ToString().ToLower()); + } return string.Join("&", query); } }