Closed zodana closed 7 years ago
Yes, because you are creating a cursor and a cursor cannot select more than one node in the tree. Using a descriptor or function in the path works like using Array.prototype.find
. For your use case, just do the following:
tree.select('list').get().filter(item => item.name === "a");
var tree=new Bab({ list:[ {name:"a",id:"1"}, {name:"a",id:"2"}, {name:"b",id:"3"} ] })
tree.select("list",{name:"a"}).get(); but return one record .