作者存档:Rucha Deodhar
MariaDB 10.9 预览版引入了 MySQL 兼容性语法扩展:range notation。根据 MDEV-22224 和 MDEV-27911 的请求,在 JSON path expression 中添加了 ‘last’ 关键字。此外,现在也支持负数索引。使用 ‘to’ 关键字实现的 Range notation 和 ‘last’ 关键字本质上都是数组元素选择器。
语法:
Range notation
[M to N] 选择从索引 M 到 N 的元素范围。
Last 关键字
[last-N] / [last] 分别选择倒数第 N 个元素和最后一个元素。
…