mpql 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/mpql/cli.rb +3 -2
- data/lib/mpql/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 63f6d1580b0cfe2dd287109819933593584580d1ce946189259bbc2e02d388e3
|
|
4
|
+
data.tar.gz: e787d7df3af32c6456437b2253e17959b4f796137be7bd62e18eca36661a02ef
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3a4e8f13e344c494f35a88310fee8458c92d45c350c3776dcffbe8130656dd425db3239f2ad15c947a064ab2eac438b721b9438a1e1bccd815964d2533412bc7
|
|
7
|
+
data.tar.gz: c053010c82aecc7459e0a99f77eb501bc1a33d45b3b95b97d319771b1624a963abe04619fb7585a4222a11f46a5f75a6a33b367392e89cf0cef2b58d2f52762d
|
data/lib/mpql/cli.rb
CHANGED
|
@@ -19,7 +19,7 @@ module Mpql
|
|
|
19
19
|
desc: "Output raw JSON without pretty-printing"
|
|
20
20
|
class_option :region, type: :string, enum: %w[us eu in],
|
|
21
21
|
desc: "MixPanel region (us, eu, in)"
|
|
22
|
-
class_option :project_id, type: :string,
|
|
22
|
+
class_option :project_id, type: :string,
|
|
23
23
|
desc: "MixPanel project ID"
|
|
24
24
|
|
|
25
25
|
desc "segmentation", "Query segmentation data for an event"
|
|
@@ -173,7 +173,8 @@ module Mpql
|
|
|
173
173
|
if distinct_ids && distinct_ids.length == 1
|
|
174
174
|
params[:distinct_id] = distinct_ids.first
|
|
175
175
|
elsif distinct_ids && distinct_ids.length > 1
|
|
176
|
-
|
|
176
|
+
conditions = distinct_ids.map { |id| %(properties["$distinct_id"] == "#{id}") }
|
|
177
|
+
where_clause = conditions.join(" or ")
|
|
177
178
|
params[:where] = params[:where] ? "(#{params[:where]}) and (#{where_clause})" : where_clause
|
|
178
179
|
end
|
|
179
180
|
result = client.engage(**params)
|
data/lib/mpql/version.rb
CHANGED