jsondb icon indicating copy to clipboard operation
jsondb copied to clipboard

Support negative step in sequence slicing

Open shaung opened this issue 11 years ago • 0 comments

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

shaung avatar Apr 18 '13 10:04 shaung