From 384b31cd64831fe4c044dcbb1202e245ec81f3e2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 18 Nov 2025 09:31:08 +0000 Subject: [PATCH 1/3] Initial plan From 325b21317cd68335fa19611978ba46f1d1423468 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 18 Nov 2025 09:35:26 +0000 Subject: [PATCH 2/3] Add missing AQL query options to PostCursorOptions Co-authored-by: rossmills99 <5502815+rossmills99@users.noreply.github.com> --- .../CursorApi/CursorApiClientTest.cs | 24 +++++++ .../CursorApi/Models/PostCursorOptions.cs | 72 +++++++++++++++++++ 2 files changed, 96 insertions(+) diff --git a/arangodb-net-standard.Test/CursorApi/CursorApiClientTest.cs b/arangodb-net-standard.Test/CursorApi/CursorApiClientTest.cs index 47b94519..f5be8f42 100644 --- a/arangodb-net-standard.Test/CursorApi/CursorApiClientTest.cs +++ b/arangodb-net-standard.Test/CursorApi/CursorApiClientTest.cs @@ -155,6 +155,30 @@ public async Task PostCursorAsync_ShouldSucceed_WhenUsingOtherOptions() Assert.Equal("This is a robbery", response.Result.First().MyProperty); } + [Fact] + public async Task PostCursorAsync_ShouldSucceed_WhenUsingNewOptions() + { + var response = await _cursorApi.PostCursorAsync( + "FOR doc IN [{ myProperty: CONCAT('This is a ', @testString) }] LIMIT 1 RETURN doc", + new Dictionary { ["testString"] = "test" }, + new PostCursorOptions + { + AllowDirtyReads = false, + AllowRetry = true, + Cache = false, + FillBlockCache = true, + MaxDNFConditionMembers = 100, + MaxNodesPerCallstack = 200, + MaxNumberOfPlans = 128, + SpillOverThresholdMemoryUsage = 134217728, + SpillOverThresholdNumRows = 5000000, + UsePlanCache = true + }); + + Assert.Single(response.Result); + Assert.Equal("This is a test", response.Result.First().MyProperty); + } + [Fact] public async Task PostCursorAsync_ShouldThrow_WhenAqlIsNotValid() { diff --git a/arangodb-net-standard/CursorApi/Models/PostCursorOptions.cs b/arangodb-net-standard/CursorApi/Models/PostCursorOptions.cs index 19f4bf20..9e57ac12 100644 --- a/arangodb-net-standard/CursorApi/Models/PostCursorOptions.cs +++ b/arangodb-net-standard/CursorApi/Models/PostCursorOptions.cs @@ -119,5 +119,77 @@ public class PostCursorOptions /// This feature is only available in the Enterprise Edition. /// public bool? SkipInaccessibleCollections { get; set; } + + /// + /// Set to true to allow reading from followers in a cluster. + /// Available in ArangoDB 3.10.0 onwards. + /// + public bool? AllowDirtyReads { get; set; } + + /// + /// Set to true to make it possible to retry fetching the latest batch from a cursor. + /// + public bool? AllowRetry { get; set; } + + /// + /// Flag to determine whether the AQL query results cache shall be used. + /// If set to false, then any query cache lookup will be skipped for the query. + /// If set to true, it will lead to the query cache being checked for the query + /// if the query cache mode is either 'on' or 'demand'. + /// + public bool? Cache { get; set; } + + /// + /// Whether to fill the in-memory block cache with any data read from storage. + /// If set to false, then any data read is not added to the block cache. + /// Can be used for queries that read a lot of data that is known to be + /// not useful in the cache. + /// + public bool? FillBlockCache { get; set; } + + /// + /// Maximum number of OR sub-nodes in the internal representation of an AQL query + /// (DNF - disjunctive normal form) for which an index will be used to evaluate + /// a query's filter condition. Above this threshold, the DNF condition will be ignored + /// and use a full collection scan instead. + /// Available in ArangoDB 3.11.0 onwards. + /// + public long? MaxDNFConditionMembers { get; set; } + + /// + /// Maximum number of calls to a recursive function. If the number of recursive calls + /// exceeds this threshold, the query is aborted with an error. + /// + public long? MaxNodesPerCallstack { get; set; } + + /// + /// Limits the maximum number of query execution plans that are created by the + /// AQL query optimizer. Use to control the amount of time spent optimizing a query. + /// + public long? MaxNumberOfPlans { get; set; } + + /// + /// The threshold for the memory usage (in bytes) after which AQL operators will + /// start to spill data to disk instead of keeping everything in RAM. Only certain + /// operations like SORT or COLLECT support spilling to disk. + /// Available in ArangoDB 3.10.0 onwards. + /// + public long? SpillOverThresholdMemoryUsage { get; set; } + + /// + /// The threshold for the number of rows after which AQL operators will start to + /// spill data to disk instead of keeping everything in RAM. Only certain + /// operations like SORT or COLLECT support spilling to disk. + /// Available in ArangoDB 3.10.0 onwards. + /// + public long? SpillOverThresholdNumRows { get; set; } + + /// + /// Whether to use the query plan cache. If set to true, the query plan cache will + /// be checked for an existing plan before optimizing the query. If set to false, + /// the query will be optimized without checking the plan cache. + /// Available in ArangoDB 3.12.4 onwards. + /// + public bool? UsePlanCache { get; set; } } } From acfb19f74e96bb4628f872e1d4bdd894efde52f5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 18 Nov 2025 09:48:11 +0000 Subject: [PATCH 3/3] Merge new options into existing test as requested Co-authored-by: rossmills99 <5502815+rossmills99@users.noreply.github.com> --- .../CursorApi/CursorApiClientTest.cs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/arangodb-net-standard.Test/CursorApi/CursorApiClientTest.cs b/arangodb-net-standard.Test/CursorApi/CursorApiClientTest.cs index f5be8f42..7fc05119 100644 --- a/arangodb-net-standard.Test/CursorApi/CursorApiClientTest.cs +++ b/arangodb-net-standard.Test/CursorApi/CursorApiClientTest.cs @@ -148,21 +148,7 @@ public async Task PostCursorAsync_ShouldSucceed_WhenUsingOtherOptions() new Dictionary { ["testString"] = "robbery" }, new PostCursorOptions { - MaxRuntime = 10 - }); - - Assert.Single(response.Result); - Assert.Equal("This is a robbery", response.Result.First().MyProperty); - } - - [Fact] - public async Task PostCursorAsync_ShouldSucceed_WhenUsingNewOptions() - { - var response = await _cursorApi.PostCursorAsync( - "FOR doc IN [{ myProperty: CONCAT('This is a ', @testString) }] LIMIT 1 RETURN doc", - new Dictionary { ["testString"] = "test" }, - new PostCursorOptions - { + MaxRuntime = 10, AllowDirtyReads = false, AllowRetry = true, Cache = false, @@ -176,7 +162,7 @@ public async Task PostCursorAsync_ShouldSucceed_WhenUsingNewOptions() }); Assert.Single(response.Result); - Assert.Equal("This is a test", response.Result.First().MyProperty); + Assert.Equal("This is a robbery", response.Result.First().MyProperty); } [Fact]