[storm] Limiting results

Gustavo Niemeyer gustavo at niemeyer.net
Wed Nov 28 11:34:04 GMT 2007


>  > A trivial thing, How does one limit results fetched from a database?
> 
> result = store.find(...)
> result.config(limit=10)
> 
> You can specify an offset, too:
> 
> result = store.find(...)
> result.config(offset=10, limit=10)

Besides what Jamu explains, you can also use normal Python-style slicing:

    result = store.find(...)
    result = result[10:21]

-- 
Gustavo Niemeyer
http://niemeyer.net



More information about the storm mailing list