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

Subdocument Exists always returns true

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 2.3.3
    • 2.2.8
    • library
    • None

    Description

      Summary: This is major, assuming I'm doing it right. Whenever I use Exists on a subdocument, it always returns true, even if the path doesn't actually exist.

      Example code:

       
       {{           var doc = new Document<dynamic>
                  {
                      Id = "Foo::123",
                      Content = new
                      {
                          Username = "mgroves",
                          Profile = new
                          {
                              PhoneNumber = "123-456-7890",
                              Address = new
                              {
                                  Street = "123 Main Rd",
                                  City = "Columbus",
                                  State = "Ohio"
                              }
                          }
                      }
                  };
                  _bucket.Upsert(doc);
       
                  var subDoc = _bucket.LookupIn<dynamic>("Foo::123").Exists("profile.address.state").Execute();
                  Console.WriteLine("Subdoc profile.address.state exists: " + subDoc.Exists("profile.address.state"));
       
                  var subDoc2 = _bucket.LookupIn<dynamic>("Foo::123").Exists("profile.address.province").Execute();
                  Console.WriteLine("Subdoc profile.address.province exists: " + subDoc2.Exists("profile.address.province"));
      }}
      

      Actual:
      The output I'm getting is:

      Subdoc profile.address.state exists: True
      Subdoc profile.address.province exists: True

      Expected
      I would expect profile.address.state to be True, but profile.address.province to be False.

      Attachments

        For Gerrit Dashboard: NCBC-1143
        # Subject Branch Project Status CR V

        Activity

          People

            jmorris Jeff Morris
            matthew.groves Matthew Groves
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty