Skip to content

Commit bdf6897

Browse files
authored
Merge pull request #43 from scrapinghub/hubstorage-client-collection-docs
update collections doc for hubstorage client
2 parents 48f59cf + 9a813e1 commit bdf6897

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

README.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,13 @@ Let's store hash and timestamp pair for foo spider. Usual workflow with `Collect
312312
>>> foo_store.count()
313313
1
314314
>>> foo_store.get('002d050ee3ff6192dcbecc4e4b4457d7')
315-
'1447221694537'
316-
>>> for result in foo_store.iter_values():
317-
# do something with _key & value pair
315+
{u'value': u'1447221694537'}
316+
>>> # iterate over _key & value pair
317+
... list(foo_store.iter_values())
318+
[{u'_key': u'002d050ee3ff6192dcbecc4e4b4457d7', u'value': u'1447221694537'}]
319+
>>> # filter by multiple keys - only values for keys that exist will be returned
320+
... list(foo_store.iter_values(key=['002d050ee3ff6192dcbecc4e4b4457d7', 'blah']))
321+
[{u'_key': u'002d050ee3ff6192dcbecc4e4b4457d7', u'value': u'1447221694537'}]
318322
>>> foo_store.delete('002d050ee3ff6192dcbecc4e4b4457d7')
319323
>>> foo_store.count()
320324
0

0 commit comments

Comments
 (0)