mongogems 0.0.1 → 0.0.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/savedPipeline.rb +16 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc20b0788d795db12040358deb32ed77388f13fb22ede8ed9d324176de5baabb
|
4
|
+
data.tar.gz: bd7984187737c6940c356527329c542236c6a284d712a29229c005121022ad45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe38bbb5cc95e7fe2fba6e7c98a2e46f9ed340f97b77aed9102c2cf1b5d3d1626002a47053b927a8bb59ffd20ccc0dd1ad7d30493a6c8a0f38c7d4769983f80a
|
7
|
+
data.tar.gz: 785812a50bbe55a40ad81c462a1a618981c1ff9196871176d36696f419e942e2440fdd6ead609c41517cda5e7648e7ea10d73bfbf1be8f3a306b7c45ca245d0a
|
data/lib/savedPipeline.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'json'
|
2
|
+
# require 'hjson'
|
2
3
|
|
3
4
|
# filename = '/Users/nitin/Downloads/Zaloni-DQ-A/607d7460cb21963a143d1d0f.json'
|
4
5
|
|
@@ -10,17 +11,27 @@ def pipeline_to_mongosh_script(infile, outfile)
|
|
10
11
|
dbname = ns_split[0]
|
11
12
|
collname = ns_split[1]
|
12
13
|
|
13
|
-
the_pipeline = [
|
14
|
+
the_pipeline = "[\n"
|
15
|
+
is_first = true
|
14
16
|
data['pipeline'].each do |pstage|
|
15
|
-
|
17
|
+
if is_first
|
18
|
+
is_first = false
|
19
|
+
else
|
20
|
+
the_pipeline += ', '
|
21
|
+
end
|
22
|
+
stage_txt = pstage['stage']
|
23
|
+
stage_txt = stage_txt.gsub("\\r", "\r").gsub("\\n", "\n")
|
24
|
+
the_pipeline += "{ #{pstage['stageOperator']}: " + stage_txt + " }"
|
16
25
|
end
|
26
|
+
the_pipeline += "\n]"
|
17
27
|
|
18
28
|
mongosh_script_out =
|
19
|
-
"
|
20
|
-
|
29
|
+
"//Query name: #{data['name']}
|
30
|
+
|
21
31
|
use #{dbname};
|
32
|
+
|
22
33
|
db.#{collname}.aggregate(
|
23
|
-
|
34
|
+
" + the_pipeline + "
|
24
35
|
, {allowDiskUse: true}
|
25
36
|
);
|
26
37
|
"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongogems
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katkam Nitin Reddy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|