mongo_aggregation_dsl 0.0.1.alpha → 0.0.2.alpha
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/aggregate/stages/lookup.rb +12 -5
- data/lib/aggregate/values/boolean.rb +22 -0
- data/lib/aggregate/values/string.rb +1 -1
- data/lib/aggregate/values/symbol.rb +1 -1
- data/mongo_aggregation_dsl.gemspec +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf04296272e988d1f33eb80b9c529c2d0c1debdc
|
4
|
+
data.tar.gz: 309b6f158ed999d4f1c87d269102cbb1151bb800
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69bf0d84c9036935cebe0d1d1582c071bc8accd4b686f2f0ec8c44e120f8a89195d734653e9d427226326ecb488dce9ed660690b592108f1cdceebee05c40d5d
|
7
|
+
data.tar.gz: c947143db1ac1d8cc94062df4029d03b01801417227463d89bd654134c4740c1c2bcb79da2810d7f0dcd41ae8d881fd13b20b7a9c7f2e654475078ff5a66a17c
|
data/Gemfile.lock
CHANGED
@@ -5,11 +5,18 @@ module Aggregate
|
|
5
5
|
# Represents an aggregation lookup
|
6
6
|
# https://docs.mongodb.com/manual/reference/operator/aggregation/lookup/#pipe._S_lookup
|
7
7
|
class Lookup < HashBase
|
8
|
-
Contract
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
Contract Or[
|
9
|
+
KeywordArgs[
|
10
|
+
from: C::ClassIncludes[[Mongoid::Document]],
|
11
|
+
as: String,
|
12
|
+
localField: String,
|
13
|
+
foreignField: String],
|
14
|
+
KeywordArgs[
|
15
|
+
from: C::ClassIncludes[[Mongoid::Document]],
|
16
|
+
as: String,
|
17
|
+
let: And[HashOf[Symbol, Symbol], C::HashMinLength[1]],
|
18
|
+
pipeline: Aggregate::Pipeline]
|
19
|
+
] => Any
|
13
20
|
def initialize(options)
|
14
21
|
super(options)
|
15
22
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Aggregate
|
4
|
+
module Values
|
5
|
+
# Returns a string wrapped in single quotes if the value or string if a key
|
6
|
+
class Boolean < Base
|
7
|
+
def to_s
|
8
|
+
inspect
|
9
|
+
end
|
10
|
+
|
11
|
+
def inspect
|
12
|
+
value.to_s
|
13
|
+
end
|
14
|
+
|
15
|
+
class << self
|
16
|
+
def handles?(value)
|
17
|
+
value.is_a? ::Boolean
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongo_aggregation_dsl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2.alpha
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- KrimsonKla
|
@@ -350,6 +350,7 @@ files:
|
|
350
350
|
- lib/aggregate/values.rb
|
351
351
|
- lib/aggregate/values/array.rb
|
352
352
|
- lib/aggregate/values/base.rb
|
353
|
+
- lib/aggregate/values/boolean.rb
|
353
354
|
- lib/aggregate/values/document_class.rb
|
354
355
|
- lib/aggregate/values/hash.rb
|
355
356
|
- lib/aggregate/values/nil.rb
|