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

using mutate in to update an existing value to null causes an IllegalArgumentException

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.1.0
    • 3.1.1
    • library
    • None
    • macOS Catalina 10.15.7, File System APFS (Case-sensitive, Encrypted)
    • 1

    Description

      There seems to be no possibility to update an existing value to null on a document.
      The following snippet will fail with an IllegalArgumentException.

      //connect to Cluster
      ...
       
      JObject o = JObject.FromObject(new
      {
        title = "Sample",
        description = (string)null
      });
      await _Collection.InsertAsync<JObject>("test", o);
       
      static void temp(MutateInSpecBuilder specs)
        {
          //any of the following lines will fail
          specs.Remove("title").Insert<string>("title", null);
          specs.Insert<string>("newKey", null, true);
          specs.Upsert<string>("title", null, true);
        }
      await _Collection.MutateInAsync("test", temp);

      I could not find any documentation that setting value to null is not supported.
      Issue https://issues.couchbase.com/browse/NCBC-2038 states, it seems supported for sub-documents

      Attachments

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

        Activity

          jmorris Jeff Morris added a comment -

          Thanks for reporting Oliver, this will be fixed in the next release 3.1.1!

          jmorris Jeff Morris added a comment - Thanks for reporting Oliver , this will be fixed in the next release 3.1.1!

          People

            jmorris Jeff Morris
            oklimberg Oliver
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty