mongogems 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/mongoindex2file +0 -0
- data/bin/mongolog2file +0 -0
- data/lib/indexes.rb +12 -3
- 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: 28de8703a8afa603455f269858c5c873846ec9f9b21fad898394d5aa35aa4e20
|
4
|
+
data.tar.gz: 6cd512e3d237476bbb546980a1fa13a5b6bc14e28184d00a1e6d81963b8ef216
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fd6977b2d1db41d6b06c06b11004fe36345aaede0bef449dda14f2d8ecf11565d3e038379db46efcd41b30034e030c92112ed043d659490aa23dd20ae53c4e7
|
7
|
+
data.tar.gz: '0268cbe9853a5bb810d73aa7fcffb16fc0d6ce0b219b0982d84693404774bbd707b0775d76d23a71db93d9d24e7d36db98b5c710c77c624800f4cbf9d7ee9f3f'
|
data/bin/mongoindex2file
CHANGED
File without changes
|
data/bin/mongolog2file
CHANGED
File without changes
|
data/lib/indexes.rb
CHANGED
@@ -30,11 +30,20 @@ def get_indexes_script(uri, db_name=nil, coll_name=nil, outfile)
|
|
30
30
|
if coll_name.nil?
|
31
31
|
colls = client.collections
|
32
32
|
else
|
33
|
-
colls = [
|
33
|
+
colls = [
|
34
|
+
client[coll_name]
|
35
|
+
]
|
34
36
|
end
|
35
37
|
|
36
38
|
colls.each do |coll|
|
37
39
|
coll.indexes.each do |idx|
|
40
|
+
|
41
|
+
#Skip the _id index
|
42
|
+
l_idx_cols = idx['key'].to_h.keys
|
43
|
+
if l_idx_cols.length == 1 and l_idx_cols.first == '_id'
|
44
|
+
next
|
45
|
+
end
|
46
|
+
|
38
47
|
txt = gen_idx_script idx, coll.name
|
39
48
|
scripts.push txt
|
40
49
|
end
|
@@ -62,5 +71,5 @@ def gen_idx_script(idIndex, collname)
|
|
62
71
|
txt = "db.#{collname}.createIndex(#{idx_spec}, #{opt_spec});"
|
63
72
|
end
|
64
73
|
|
65
|
-
#
|
66
|
-
#
|
74
|
+
# mdb_uri = 'mongodb://localhost'
|
75
|
+
# get_indexes_script mdb_uri, nil, nil, 'idx_out.txt'
|
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.5
|
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-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mongo
|