API ReferenceJSON
JSONArrPop
Remove and return an element from a JSON array
Syntax
Redix.JSONArrPop(key, path, index, callback)Parameters
Prop
Type
Returns
Prop
Type
Examples
-- Pop last item
Redix.JSONArrPop('character:123', '$.inventory', -1, function(err, item)
if not err and item then
print('Removed item:', item.item)
end
end)
-- Pop first item
Redix.JSONArrPop('character:123', '$.notifications', 0)