NoDB icon indicating copy to clipboard operation
NoDB copied to clipboard

Ranged Queries

Open Miserlou opened this issue 7 years ago • 2 comments

Miserlou avatar Apr 09 '17 23:04 Miserlou

ex,

nodb.range(start=10, end=20) # [<User id:10>, ... , <User id:20> ]

Miserlou avatar Apr 10 '17 00:04 Miserlou

what about being able to add a range_index, similar to DynamoDB range keys?

nodb.index = 'name'
nodb.range_index = 'login_date'

save could create a key structure like bucket_name/str(self._format_index_value())/int(range_index)

then you could have a query like

nodb.filter(index='jeff', range__gte=datetime.datetime(year=2018, month=1, day=1).timestamp())
# [<User: jeff, login_date: 2019...>, ...]

bendog avatar Sep 17 '19 05:09 bendog