Unable to fetch the list key with single leaf entry

My list looks as below.

list a {
 key "b"
 leaf b {
  type string;

cdb has entries as:

/key-path-before the list/a{b1}
/key-path-before the list/a{b2}

I need to fetch the leaf b1 and b2 entries to write an upgrade proc based on these two values.
i was able to get number of instances as 2 for the path “/key-path-before the list/a”, but unable to get the values b1 and b2. I tried to use the following:

  1. /key-path-before the list/a[0] to make use of cdb_get_object, it failed.
  2. /key-path-before the list/a[0] to make use of cdb_get, it failed.

Kindly provide your inputs.

Perhaps you are also looking for something like How to traverse a list with leaf as a key element - #2 by mghosh



Thanks for the suggestion. I was looking for similar implementation. It worked with the above suggestion.