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

Subdocument Exists always returns true

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.8
    • Fix Version/s: 2.3.3
    • Component/s: library
    • Labels:
      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

        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

            • Assignee:
              jmorris Jeff Morris
              Reporter:
              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

                  Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.