avpath可以像xpath/jspath那样去选择、更新、插入、删除Avro形式的数据。它可以作为Java/Scala的API库,或者用作Avro记录数据服务。它的表达和jspath很相似。
示例代码:
// find first book titleavpath.select(doc, ".books[0].title")// ['Clean Code']// find first title of booksavpath.select(doc, ".books.title[0]")// 'Clean Code'// find last book titleavpath.select(doc, ".books[-1].title")// ['JavaScript: The Good Parts']// find two first book titlesavpath.select(doc, ".books[:2].title")// ['Clean Code', 'Maintainable JavaScript']// find two last book titlesavpath.select(doc, ".books[-2:].title")// ['Agile Software Development', 'JavaScript: The Good Parts']// find two book titles from second positionavpath.select(doc, ".books[1:3].title")// ['Maintainable JavaScript', 'Agile Software Development']
评论