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

Upsert/Insert null with MutateIn fails with Invalid arguments (0x0004)

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • 3.0.6
    • 3.0.7
    • None
    • None
    • 1

    Description

      MutateIn Upsert/Insert with a null property value hits the wire, and then fails.

      Here is a reproduction I ran into while testing Upsert-and-remove. The commented code works. The final MutateIn throws.

              [Fact]
              public async Task Upsert_and_remove_when_inserting()
              {
                  var collection = await _fixture.GetDefaultCollection().ConfigureAwait(false);
                  var documentKey = nameof(Upsert_and_remove_when_inserting) + Guid.NewGuid().ToString();
                  var sampleDoc = new {foo = "bar"};
                  var insertResult =
                      await collection.InsertAsync(documentKey, sampleDoc, opts => opts.Expiry(TimeSpan.FromSeconds(30)));
                  ////var mutateInResult = await collection.MutateInAsync(documentKey, specs =>
                  ////    specs.Upsert("xattr1", string.Empty, isXattr: true, createPath: true)
                  ////        .Remove("xattr1", isXattr: true)
                  ////        .SetDoc(sampleDoc));
                  ///
       
                  var result = await collection.MutateInAsync(documentKey, specs =>
                      specs.Insert("bar", (object)null));
       
              }
      

      Attachments

        Issue Links

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

          Activity

            There are no comments yet on this issue.

            People

              richard.ponton Richard Ponton
              richard.ponton Richard Ponton
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty