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

Subdocument Operation LookupInAsync must throw PathNotFoundException

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • 3.2.6
    • 3.2.4
    • None
    • None
    • SDK 3.2.4
    • 1

    Description

      Performing a basic test it was found that PathNotFoundException was not thrown when a subdocument path doesnt exist. 

      Look at the code below

       

       

      static async Task Main(string[] args)
       {
       try
       {
       var cluster = await Couchbase.Cluster.ConnectAsync("couchbase://localhost", "Administrator", "password");
       var bucket = await cluster.BucketAsync("travel-sample");
      var scope = await bucket.ScopeAsync("inventory");
      var coll = await scope.CollectionAsync("airport");
      var key = "airport-500001";
      var document = new { id=500001, type = "airport", airportname = "Francis Airport", Country = "France" };
      await coll.UpsertAsync<dynamic>(key, document);
      var airportDoc = await coll.GetAsync(key);
      Console.WriteLine(airportDoc.ContentAs<dynamic>());
      var result = await coll.LookupInAsync(key, specs=>specs.Get("some-field-that-doesnt-exist"));
      Console.WriteLine("LookupIn Output Is " + result.ContentAs<string>(0)); 
       
       }
       catch (CouchbaseException ex)
       {
       Console.WriteLine(ex); 
       
       }
       catch (Exception ex)
       {
       Console.WriteLine(ex); 
       }
       Console.Read();
       }
      

       

      Attachments

        Issue Links

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

          Activity

            People

              jmorris Jeff Morris
              arun.vijayraghavan Arun Vijayraghavan (Inactive)
              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