Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-3068

MutateIn.ArrayInsert throws PathInvalidException

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • backlog-3.0
    • 3.2.5
    • library
    • None
    • 1

    Description

       public async Task Test_MutateInAsync_ArrayInsert()
              {
                  var col = await GetDefaultCollection();
                  var doc1 = Guid.NewGuid().ToString();            await col.UpsertAsync(doc1, new { Name = doc1, Id = 1, Items = new[] { 1, 2, 3 } },
                      options => options.Expiry(TimeSpan.FromSeconds(2)));            var result = await col.MutateInAsync(doc1, specs => specs.ArrayInsert("items", new[] {8, 9}));
                  Assert.True(result.Cas > 0);            var result1 = await col.GetAsync(doc1);
                  var content = result1.ContentAs<JObject>();
                  Assert.Contains(8, content?.SelectToken("items").ToObject<List<int>>());
                  Assert.Contains(9, content?.SelectToken("items").ToObject<List<int>>());
              } 

       

      Couchbase.Core.Exceptions.KeyValue.PathInvalidException
      Exception of type 'Couchbase.Core.Exceptions.KeyValue.PathInvalidException' was thrown.
         at Couchbase.Core.ClusterNode.ExecuteOp(Func`4 sender, IOperation op, Object state, CancellationTokenPair tokenPair) in C:\Users\Jeff Morris\source\couchbase-net-client\src\Couchbase\Core\ClusterNode.cs:line 585
         at Couchbase.CouchbaseBucket.SendAsync(IOperation op, CancellationTokenPair tokenPair) in C:\Users\Jeff Morris\source\couchbase-net-client\src\Couchbase\CouchbaseBucket.cs:line 212
         at Couchbase.Core.Retry.RetryOrchestrator.RetryAsync(BucketBase bucket, IOperation operation, CancellationTokenPair tokenPair) in C:\Users\Jeff Morris\source\couchbase-net-client\src\Couchbase\Core\Retry\RetryOrchestrator.cs:line 181
         at Couchbase.KeyValue.CouchbaseCollection.MutateInAsync(String id, IEnumerable`1 specs, MutateInOptions options) in C:\Users\Jeff Morris\source\couchbase-net-client\src\Couchbase\KeyValue\CouchbaseCollection.cs:line 708
         at Couchbase.CombinationTests.Tests.KeyValue.KeyValueTests.Test_MutateInAsync_ArrayInsert() in C:\Users\Jeff Morris\source\couchbase-net-client\tests\Couchbase.CombinationTests\Tests\KeyValue\KeyValueTests.cs:line 365

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jmorris Jeff Morris
            jmorris Jeff Morris
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty