jsondb
jsondb copied to clipboard
Support negative step in sequence slicing
The current implementation of slicing does not support negative step.
Given the following data
db = jsondb.create({
'name' : 'foo',
'items': [
{'id' : 0, 'name' : 'a'},
{'id' : 1, 'name' : 'b'},
{'id' : 2, 'name' : 'c'},
]
})
The output of print(db.query('$.items[::-1].name'))
should be c b a
instead of a b c