The MariaDB 10.9 preview releases introduce a MySQL compatibility syntax extension, range notation. The ‘last’ keyword was added in JSON path expression, as requested in MDEV-22224 and MDEV-27911. Additionally, negative indexes are now also supported. Range notation, implemented using the ‘to’ keyword, and the ‘last’ keyword, is basically an array element selector.
[M to N] selects a range of elements starting from index M to N.
[last-N] / [last] selects the Nth from last element, and last element, respectively.