toy-dynamo 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/toy/dynamo/querying.rb +10 -1
- data/lib/toy/dynamo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93ec8909dee1398552fd8a1b494c58a76f08cb46
|
4
|
+
data.tar.gz: 9c82f7a4e2e13c4bc1085967891861be7e87ff5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53116c844ba3aaf35e63a474316769014172517f154aa1d5d9afa097d4627ece97bd275a3027efaf96291f01a7a392508e083434f1ff28c424e477e5632d105e
|
7
|
+
data.tar.gz: 9199026688e1410dd7a6775f1797b7b2e55c74194651ec8d7ec6bc9e6b4f3033bb448ee1568ff04fb6bc891097f60b051b73ef07b19a3ecc0205673396b53acb
|
data/lib/toy/dynamo/querying.rb
CHANGED
@@ -17,6 +17,8 @@ module Toy
|
|
17
17
|
raise ArgumentError, "no range_key specified for this table" if dynamo_table.range_keys.blank? && global_secondary_indexes.blank?
|
18
18
|
aggregated_results = []
|
19
19
|
|
20
|
+
# Useful if doing pagination where you would need the last key evaluated
|
21
|
+
return_last_evaluated_key = options.delete(:return_last_evaluated_key)
|
20
22
|
batch_size = options.delete(:batch) || DEFAULT_BATCH_SIZE
|
21
23
|
max_results_limit = options[:limit]
|
22
24
|
if options[:limit] && options[:limit] > batch_size
|
@@ -53,7 +55,14 @@ module Toy
|
|
53
55
|
end
|
54
56
|
end
|
55
57
|
|
56
|
-
|
58
|
+
if return_last_evaluated_key
|
59
|
+
{
|
60
|
+
last_evaluated_key: response.last_evaluated_key,
|
61
|
+
members: aggregated_results
|
62
|
+
}
|
63
|
+
else
|
64
|
+
aggregated_results
|
65
|
+
end
|
57
66
|
end
|
58
67
|
|
59
68
|
def count_range(hash_value, options={})
|
data/lib/toy/dynamo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: toy-dynamo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cary Dunn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|