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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e639c23eb9a584d08e120ea876bcdeeb9df0ac92ee229d40a86edde6efd8e0a8
4
- data.tar.gz: 20d5eda11c6d4d8cc21e60ab7d28f27b25d81a1feca0d8ff07fda85c2b9af02f
3
+ metadata.gz: 28de8703a8afa603455f269858c5c873846ec9f9b21fad898394d5aa35aa4e20
4
+ data.tar.gz: 6cd512e3d237476bbb546980a1fa13a5b6bc14e28184d00a1e6d81963b8ef216
5
5
  SHA512:
6
- metadata.gz: d73f83bf2fc439efa326d609c8a1f68370372ef5d4a10f03aa920481db6057dd84b7578faa4ded4b98c4e585092b43336dfc7546ce70efd6b7023c457f8e66c6
7
- data.tar.gz: 363ad86fecedf6bb90d4d2d2aae9c0d3d1e82269500dcc78daee2520d69edb4d317208db4fbebb9821d6c01cec4c2101ce50bd156cc855a313d25439d59cb97a
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 = [coll_name]
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
- # script = (get_indexes_script 'mongodb://localhost').join "\n"
66
- # puts script
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
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-06 00:00:00.000000000 Z
11
+ date: 2021-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mongo