-
I have a yang model that looks like this: list my-list {
key 'key-a key-b';
leaf key-a {
type string;
}
leaf key-b {
type string;
}
leaf style {
type enumeration {
enum style-a;
enum style-b;
}
}
} I should be able to access the
This normally works when getting data out of my datastore. However, I am now trying to create nodes using int rc = lyd_new_path(NULL, context, "/my-list[key-a='hello'][key-b='goodbye']/style", "style-a", 0, NULL); For lists with 1 key, this method has been working. What is the proper way to create new nodes when the list has multiple keys? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
After stepping through the libyang code using gdb, I was able to determine that the predicate checking function specifically looks for the |
Beta Was this translation helpful? Give feedback.
After stepping through the libyang code using gdb, I was able to determine that the predicate checking function specifically looks for the
[
character, then the name, then the=
character, then a literal, and finally the]
character. So the syntax usingand
is not allowed. After that, I later determined that mykey-b
was specified as[key-b=1]
instead of[key-b='1']
(it was not quoted). After fixing these issues, the function worked.