tdiary-io-mongodb 5.0.4 → 5.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tdiary/io/mongodb.rb +8 -2
- data/tdiary-io-mongodb.gemspec +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e238fc1411ee9e6c2799b957680df12df93b21e615d7cd1b6710a923fc94946a
|
4
|
+
data.tar.gz: bf84b576fdfca7607fda1f7b9b554f40f2ca3193c2e96590a1175bab348c5887
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d39177a691525bf37a60c4f0bec0673db8c24487d9d7cd9ab6081f206ddbf4a1b478ab67601fc7fead882950c724644b90ddd87e526e867f9b65e1329812fb24
|
7
|
+
data.tar.gz: 95d8171ea0a0094f2b468e3dd10634a77b948609a7bd7aea98f26925e0440cca9c37fc8d318ef1702fcb8aabb1715352d022b9062c37a7ffd868721ec6ad4592
|
data/lib/tdiary/io/mongodb.rb
CHANGED
@@ -183,9 +183,15 @@ module TDiary
|
|
183
183
|
end
|
184
184
|
|
185
185
|
def calendar
|
186
|
+
mongo_project = {
|
187
|
+
"$group" => {
|
188
|
+
"_id" => {"year" => "$year", "month" => "$month"},
|
189
|
+
"count" => {"$sum" => 1}
|
190
|
+
}
|
191
|
+
}
|
186
192
|
calendar = Hash.new{|hash, key| hash[key] = []}
|
187
|
-
Diary.
|
188
|
-
calendar[
|
193
|
+
Diary.collection.aggregate([mongo_project]).map do |cal|
|
194
|
+
calendar[cal['_id']['year']] << cal['_id']['month']
|
189
195
|
end
|
190
196
|
calendar
|
191
197
|
end
|
data/tdiary-io-mongodb.gemspec
CHANGED
@@ -4,8 +4,8 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "tdiary-io-mongodb"
|
7
|
-
spec.version = "5.0
|
8
|
-
spec.authors = ["
|
7
|
+
spec.version = "5.1.0"
|
8
|
+
spec.authors = ["Tada, Tadashi"]
|
9
9
|
spec.email = ["t@tdtds.jp"]
|
10
10
|
spec.description = %q{MongoDB adapter for tDiary}
|
11
11
|
spec.summary = %q{MongoDB adapter for tDiary}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tdiary-io-mongodb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0
|
4
|
+
version: 5.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Tada, Tadashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mongoid
|
@@ -161,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
161
|
- !ruby/object:Gem::Version
|
162
162
|
version: '0'
|
163
163
|
requirements: []
|
164
|
-
rubygems_version: 3.
|
164
|
+
rubygems_version: 3.1.2
|
165
165
|
signing_key:
|
166
166
|
specification_version: 4
|
167
167
|
summary: MongoDB adapter for tDiary
|