mongo 2.0.0.beta → 2.0.0.rc

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/Rakefile +14 -1
  5. data/lib/mongo.rb +2 -1
  6. data/lib/mongo/auth.rb +2 -2
  7. data/lib/mongo/bulk_write.rb +52 -0
  8. data/lib/mongo/bulk_write/bulk_writable.rb +191 -0
  9. data/lib/mongo/bulk_write/deletable.rb +60 -0
  10. data/lib/mongo/bulk_write/insertable.rb +52 -0
  11. data/lib/mongo/bulk_write/ordered_bulk_write.rb +48 -0
  12. data/lib/mongo/bulk_write/replacable.rb +57 -0
  13. data/lib/mongo/bulk_write/unordered_bulk_write.rb +46 -0
  14. data/lib/mongo/bulk_write/updatable.rb +68 -0
  15. data/lib/mongo/client.rb +15 -2
  16. data/lib/mongo/cluster/topology/replica_set.rb +1 -1
  17. data/lib/mongo/cluster/topology/sharded.rb +1 -1
  18. data/lib/mongo/cluster/topology/standalone.rb +1 -1
  19. data/lib/mongo/cluster/topology/unknown.rb +1 -1
  20. data/lib/mongo/collection.rb +1 -1
  21. data/lib/mongo/collection/view/aggregation.rb +1 -1
  22. data/lib/mongo/collection/view/readable.rb +1 -1
  23. data/lib/mongo/collection/view/writable.rb +5 -5
  24. data/lib/mongo/cursor.rb +0 -2
  25. data/lib/mongo/error.rb +4 -3
  26. data/lib/mongo/error/{bulk_write_failure.rb → bulk_write_error.rb} +2 -2
  27. data/lib/mongo/error/invalid_bulk_operation.rb +2 -2
  28. data/lib/mongo/error/invalid_bulk_operation_type.rb +36 -0
  29. data/lib/mongo/error/{empty_batch.rb → multi_index_drop.rb} +5 -10
  30. data/lib/mongo/grid/file/metadata.rb +1 -8
  31. data/lib/mongo/grid/fs.rb +5 -5
  32. data/lib/mongo/index/view.rb +90 -34
  33. data/lib/mongo/operation.rb +0 -1
  34. data/lib/mongo/operation/aggregate.rb +2 -2
  35. data/lib/mongo/operation/aggregate/result.rb +4 -0
  36. data/lib/mongo/operation/bulk_delete/result.rb +2 -127
  37. data/lib/mongo/operation/bulk_insert/result.rb +2 -132
  38. data/lib/mongo/operation/bulk_update/result.rb +2 -142
  39. data/lib/mongo/operation/command.rb +1 -1
  40. data/lib/mongo/operation/executable.rb +3 -3
  41. data/lib/mongo/operation/list_collections/result.rb +0 -2
  42. data/lib/mongo/operation/map_reduce.rb +1 -1
  43. data/lib/mongo/operation/read/collections_info.rb +1 -1
  44. data/lib/mongo/operation/read/get_more.rb +1 -1
  45. data/lib/mongo/operation/read/indexes.rb +1 -1
  46. data/lib/mongo/operation/read/list_collections.rb +1 -1
  47. data/lib/mongo/operation/read/list_indexes.rb +1 -1
  48. data/lib/mongo/operation/read/query.rb +1 -1
  49. data/lib/mongo/operation/specifiable.rb +18 -1
  50. data/lib/mongo/operation/write.rb +2 -0
  51. data/lib/mongo/operation/write/bulk_delete.rb +5 -19
  52. data/lib/mongo/operation/write/bulk_insert.rb +9 -40
  53. data/lib/mongo/operation/write/bulk_mergable.rb +67 -0
  54. data/lib/mongo/operation/write/bulk_update.rb +5 -19
  55. data/lib/mongo/operation/write/command.rb +1 -1
  56. data/lib/mongo/operation/write/command/{ensure_index.rb → create_index.rb} +4 -9
  57. data/lib/mongo/operation/write/command/delete.rb +4 -4
  58. data/lib/mongo/operation/write/command/drop_index.rb +1 -1
  59. data/lib/mongo/operation/write/command/insert.rb +4 -4
  60. data/lib/mongo/operation/write/command/update.rb +4 -4
  61. data/lib/mongo/operation/write/create_index.rb +12 -7
  62. data/lib/mongo/operation/write/create_user.rb +1 -1
  63. data/lib/mongo/operation/write/delete.rb +1 -1
  64. data/lib/mongo/operation/write/drop_index.rb +1 -1
  65. data/lib/mongo/operation/write/insert.rb +1 -1
  66. data/lib/mongo/operation/write/legacy_bulk_mergable.rb +83 -0
  67. data/lib/mongo/operation/write/remove_user.rb +1 -1
  68. data/lib/mongo/operation/write/update.rb +1 -1
  69. data/lib/mongo/{bulk.rb → options.rb} +2 -2
  70. data/lib/mongo/options/mapper.rb +78 -0
  71. data/lib/mongo/server.rb +2 -2
  72. data/lib/mongo/server/connection_pool/queue.rb +1 -1
  73. data/lib/mongo/server/description.rb +1 -1
  74. data/lib/mongo/server/description/inspector.rb +1 -1
  75. data/lib/mongo/server_selector.rb +1 -1
  76. data/lib/mongo/socket/unix.rb +2 -4
  77. data/lib/mongo/version.rb +1 -1
  78. data/lib/mongo/write_concern/acknowledged.rb +15 -1
  79. data/lib/mongo/write_concern/normalizable.rb +0 -22
  80. data/lib/mongo/write_concern/unacknowledged.rb +12 -0
  81. data/spec/mongo/bulk/bulk_write_spec.rb +178 -91
  82. data/spec/mongo/collection/view/aggregation_spec.rb +14 -1
  83. data/spec/mongo/collection/view/explainable_spec.rb +1 -1
  84. data/spec/mongo/collection/view/map_reduce_spec.rb +2 -2
  85. data/spec/mongo/collection/view/readable_spec.rb +2 -2
  86. data/spec/mongo/collection/view/writable_spec.rb +7 -7
  87. data/spec/mongo/collection/view_spec.rb +14 -5
  88. data/spec/mongo/collection_spec.rb +5 -5
  89. data/spec/mongo/cursor_spec.rb +3 -3
  90. data/spec/mongo/database_spec.rb +4 -8
  91. data/spec/mongo/grid/fs_spec.rb +8 -8
  92. data/spec/mongo/index/view_spec.rb +139 -35
  93. data/spec/mongo/operation/aggregate_spec.rb +14 -22
  94. data/spec/mongo/operation/command_spec.rb +8 -16
  95. data/spec/mongo/operation/map_reduce_spec.rb +1 -1
  96. data/spec/mongo/operation/read/indexes_spec.rb +2 -2
  97. data/spec/mongo/operation/write/bulk_delete_spec.rb +1 -239
  98. data/spec/mongo/operation/write/bulk_insert_spec.rb +3 -234
  99. data/spec/mongo/operation/write/bulk_update_spec.rb +1 -289
  100. data/spec/mongo/operation/write/command/delete_spec.rb +0 -13
  101. data/spec/mongo/operation/write/command/insert_spec.rb +0 -14
  102. data/spec/mongo/operation/write/command/update_spec.rb +0 -14
  103. data/spec/mongo/operation/write/{ensure_index_spec.rb → create_index_spec.rb} +8 -26
  104. data/spec/mongo/operation/write/delete_spec.rb +1 -1
  105. data/spec/mongo/operation/write/drop_index_spec.rb +1 -1
  106. data/spec/mongo/operation/write/insert_spec.rb +3 -3
  107. data/spec/mongo/operation/write/update_spec.rb +1 -1
  108. data/spec/mongo/server_selection_spec.rb +2 -2
  109. data/spec/support/authorization.rb +4 -2
  110. data/spec/support/server_selection.rb +25 -8
  111. data/spec/support/server_selection/selection/ReplicaSetNoPrimary/read/Nearest.yml +4 -10
  112. data/spec/support/server_selection/selection/ReplicaSetNoPrimary/read/Nearest_non_matching.yml +6 -12
  113. data/spec/support/server_selection/selection/ReplicaSetNoPrimary/read/Primary.yml +4 -6
  114. data/spec/support/server_selection/selection/ReplicaSetNoPrimary/read/PrimaryPreferred.yml +4 -10
  115. data/spec/support/server_selection/selection/ReplicaSetNoPrimary/read/PrimaryPreferred_non_matching.yml +6 -12
  116. data/spec/support/server_selection/selection/ReplicaSetNoPrimary/read/Secondary.yml +4 -10
  117. data/spec/support/server_selection/selection/ReplicaSetNoPrimary/read/SecondaryPreferred.yml +4 -10
  118. data/spec/support/server_selection/selection/ReplicaSetNoPrimary/read/SecondaryPreferred_non_matching.yml +6 -12
  119. data/spec/support/server_selection/selection/ReplicaSetNoPrimary/read/Secondary_non_matching.yml +6 -12
  120. data/spec/support/server_selection/selection/ReplicaSetWithPrimary/read/Nearest.yml +9 -17
  121. data/spec/support/server_selection/selection/ReplicaSetWithPrimary/read/Nearest_non_matching.yml +9 -17
  122. data/spec/support/server_selection/selection/ReplicaSetWithPrimary/read/Primary.yml +6 -10
  123. data/spec/support/server_selection/selection/ReplicaSetWithPrimary/read/PrimaryPreferred.yml +11 -21
  124. data/spec/support/server_selection/selection/ReplicaSetWithPrimary/read/PrimaryPreferred_non_matching.yml +11 -18
  125. data/spec/support/server_selection/selection/ReplicaSetWithPrimary/read/Secondary.yml +31 -0
  126. data/spec/support/server_selection/selection/ReplicaSetWithPrimary/read/SecondaryPreferred.yml +31 -0
  127. data/spec/support/server_selection/selection/ReplicaSetWithPrimary/read/SecondaryPreferred_non_matching.yml +29 -0
  128. data/spec/support/server_selection/selection/ReplicaSetWithPrimary/read/Secondary_non_matching.yml +26 -0
  129. data/spec/support/server_selection/selection/Sharded/read/SecondaryPreferred.yml +4 -10
  130. data/spec/support/server_selection/selection/Single/read/SecondaryPreferred.yml +2 -6
  131. data/spec/support/server_selection/selection/Unknown/read/SecondaryPreferred.yml +0 -2
  132. data/spec/support/shared/bulk_write.rb +109 -72
  133. metadata +29 -10
  134. metadata.gz.sig +0 -0
  135. data/lib/mongo/bulk/bulk_write.rb +0 -307
  136. data/lib/mongo/operation/batchable.rb +0 -103
@@ -11,7 +11,7 @@ describe Mongo::Operation::Write::DropIndex do
11
11
  end
12
12
 
13
13
  before do
14
- authorized_collection.indexes.create(spec, unique: true)
14
+ authorized_collection.indexes.create_one(spec, unique: true)
15
15
  end
16
16
 
17
17
  let(:operation) do
@@ -82,12 +82,12 @@ describe Mongo::Operation::Write::Insert do
82
82
  describe '#execute' do
83
83
 
84
84
  before do
85
- authorized_collection.indexes.create({ name: 1 }, { unique: true })
85
+ authorized_collection.indexes.create_one({ name: 1 }, { unique: true })
86
86
  end
87
87
 
88
88
  after do
89
- authorized_collection.find.remove_many
90
- authorized_collection.indexes.drop({ name: 1 })
89
+ authorized_collection.find.delete_many
90
+ authorized_collection.indexes.drop_one('name_1')
91
91
  end
92
92
 
93
93
  context 'when inserting a single document' do
@@ -78,7 +78,7 @@ describe Mongo::Operation::Write::Update do
78
78
  end
79
79
 
80
80
  after do
81
- authorized_collection.find.remove_many
81
+ authorized_collection.find.delete_many
82
82
  end
83
83
 
84
84
  context 'when updating a single document' do
@@ -28,7 +28,7 @@ describe 'Server Selection' do
28
28
  address = Mongo::Address.new(server['address'])
29
29
  Mongo::Server.new(address, Mongo::Event::Listeners.new).tap do |s|
30
30
  allow(s).to receive(:average_round_trip_time).and_return(server['avg_rtt_ms'])
31
- allow(s).to receive(:tags).and_return(server['tag_sets'].first)
31
+ allow(s).to receive(:tags).and_return(server['tags'])
32
32
  allow(s).to receive(:secondary?).and_return(server['type'] == 'RSSecondary')
33
33
  allow(s).to receive(:primary?).and_return(server['type'] == 'RSPrimary')
34
34
  end
@@ -40,7 +40,7 @@ describe 'Server Selection' do
40
40
  address = Mongo::Address.new(server['address'])
41
41
  Mongo::Server.new(address, Mongo::Event::Listeners.new).tap do |s|
42
42
  allow(s).to receive(:average_round_trip_time).and_return(server['avg_rtt_ms'])
43
- allow(s).to receive(:tags).and_return(server['tag_sets'].first)
43
+ allow(s).to receive(:tags).and_return(server['tags'])
44
44
  end
45
45
  end
46
46
  end
@@ -74,7 +74,9 @@ TEST_USER = Mongo::Auth::User.new(
74
74
  password: 'password',
75
75
  roles: [
76
76
  { role: Mongo::Auth::Roles::READ_WRITE, db: TEST_DB },
77
- { role: Mongo::Auth::Roles::DATABASE_ADMIN, db: TEST_DB }
77
+ { role: Mongo::Auth::Roles::DATABASE_ADMIN, db: TEST_DB },
78
+ { role: Mongo::Auth::Roles::READ_WRITE, db: 'invalid_database' },
79
+ { role: Mongo::Auth::Roles::DATABASE_ADMIN, db: 'invalid_database' }
78
80
  ]
79
81
  )
80
82
 
@@ -95,7 +97,7 @@ TEST_READ_WRITE_USER = Mongo::Auth::User.new(
95
97
  # The write concern to use in the tests.
96
98
  #
97
99
  # @since 2.0.0
98
- WRITE_CONCERN = CONNECT == :direct || :sharded ? { w: 1 } : { w: 'majority' }
100
+ WRITE_CONCERN = (CONNECT == :replica_set) ? { w: ADDRESSES.size } : { w: 1 }
99
101
 
100
102
  # Provides an authorized mongo client on the default test database for the
101
103
  # default test user.
@@ -56,12 +56,6 @@ module Mongo
56
56
  # @since 2.0.0
57
57
  attr_reader :suitable_servers
58
58
 
59
- # @return [ Array<Hash> ] in_latency_window The subset of suitable servers that falls
60
- # within the allowable latency window.
61
- #
62
- # @since 2.0.0
63
- attr_reader :in_latency_window
64
-
65
59
  # @return [ Mongo::Cluster::Topology ] type The topology type.
66
60
  #
67
61
  # @since 2.0.0
@@ -80,8 +74,7 @@ module Mongo
80
74
  @description = "#{@test['topology_description']['type']}: #{File.basename(file)}"
81
75
  @read_preference = @test['read_preference']
82
76
  @read_preference['mode'] = READ_PREFERENCES[@read_preference['mode']]
83
- @candidate_servers = @test['candidate_servers']
84
- @eligible_servers = @test['eligible_servers']
77
+ @candidate_servers = @test['topology_description']['servers']
85
78
  @suitable_servers = @test['suitable_servers']
86
79
  @in_latency_window = @test['in_latency_window']
87
80
  @type = TOPOLOGY_TYPES[@test['topology_description']['type']]
@@ -134,6 +127,30 @@ module Mongo
134
127
  def invalid_server_preference?
135
128
  read_preference['mode'] == 'Primary' && read_preference['tag_sets']
136
129
  end
130
+
131
+ # The subset of suitable servers that falls within the allowable latency
132
+ # window.
133
+ # We have to correct for our server selection algorithm that adds the primary
134
+ # to the end of the list for SecondaryPreferred read preference mode.
135
+ #
136
+ # @example Get the list of suitable servers within the latency window.
137
+ # spec.in_latency_window
138
+ #
139
+ # @return [ Array<Hash> ] The servers within the latency window.
140
+ #
141
+ # @since 2.0.0
142
+ def in_latency_window
143
+ if read_preference['mode'] == :secondary_preferred && primary
144
+ return @in_latency_window.push(primary).uniq
145
+ end
146
+ @in_latency_window
147
+ end
148
+
149
+ private
150
+
151
+ def primary
152
+ @candidate_servers.find { |s| s['type'] == 'RSPrimary' }
153
+ end
137
154
  end
138
155
  end
139
156
  end
@@ -6,25 +6,19 @@ topology_description:
6
6
  address: b:27017
7
7
  avg_rtt_ms: 5
8
8
  type: RSSecondary
9
- tag_sets:
10
- - data_center: nyc
9
+ tags:
10
+ data_center: nyc
11
11
  - &2
12
12
  address: c:27017
13
13
  avg_rtt_ms: 100
14
14
  type: RSSecondary
15
- tag_sets:
16
- - data_center: nyc
15
+ tags:
16
+ data_center: nyc
17
17
  operation: read
18
18
  read_preference:
19
19
  mode: Nearest
20
20
  tag_sets:
21
21
  - data_center: nyc
22
- candidate_servers:
23
- - *1
24
- - *2
25
- eligible_servers:
26
- - *1
27
- - *2
28
22
  suitable_servers:
29
23
  - *1
30
24
  - *2
@@ -2,26 +2,20 @@
2
2
  topology_description:
3
3
  type: ReplicaSetNoPrimary
4
4
  servers:
5
- - &1
6
- address: b:27017
5
+ - address: b:27017
7
6
  avg_rtt_ms: 5
8
7
  type: RSSecondary
9
- tag_sets:
10
- - data_center: nyc
11
- - &2
12
- address: c:27017
8
+ tags:
9
+ data_center: nyc
10
+ - address: c:27017
13
11
  avg_rtt_ms: 100
14
12
  type: RSSecondary
15
- tag_sets:
16
- - data_center: nyc
13
+ tags:
14
+ data_center: nyc
17
15
  operation: read
18
16
  read_preference:
19
17
  mode: Nearest
20
18
  tag_sets:
21
19
  - data_center: sf
22
- candidate_servers:
23
- - *1
24
- - *2
25
- eligible_servers: []
26
20
  suitable_servers: []
27
21
  in_latency_window: []
@@ -5,19 +5,17 @@ topology_description:
5
5
  - address: b:27017
6
6
  avg_rtt_ms: 5
7
7
  type: RSSecondary
8
- tag_sets:
9
- - data_center: nyc
8
+ tags:
9
+ data_center: nyc
10
10
  - address: c:27017
11
11
  avg_rtt_ms: 100
12
12
  type: RSSecondary
13
- tag_sets:
14
- - data_center: nyc
13
+ tags:
14
+ data_center: nyc
15
15
  operation: read
16
16
  read_preference:
17
17
  mode: Primary
18
18
  tag_sets:
19
19
  - {}
20
- candidate_servers: []
21
- eligible_servers: []
22
20
  suitable_servers: []
23
21
  in_latency_window: []
@@ -6,25 +6,19 @@ topology_description:
6
6
  address: b:27017
7
7
  avg_rtt_ms: 5
8
8
  type: RSSecondary
9
- tag_sets:
10
- - data_center: nyc
9
+ tags:
10
+ data_center: nyc
11
11
  - &2
12
12
  address: c:27017
13
13
  avg_rtt_ms: 100
14
14
  type: RSSecondary
15
- tag_sets:
16
- - data_center: nyc
15
+ tags:
16
+ data_center: nyc
17
17
  operation: read
18
18
  read_preference:
19
19
  mode: PrimaryPreferred
20
20
  tag_sets:
21
21
  - {}
22
- candidate_servers:
23
- - *1
24
- - *2
25
- eligible_servers:
26
- - *1
27
- - *2
28
22
  suitable_servers:
29
23
  - *1
30
24
  - *2
@@ -2,26 +2,20 @@
2
2
  topology_description:
3
3
  type: ReplicaSetNoPrimary
4
4
  servers:
5
- - &1
6
- address: b:27017
5
+ - address: b:27017
7
6
  avg_rtt_ms: 5
8
7
  type: RSSecondary
9
- tag_sets:
10
- - data_center: nyc
11
- - &2
12
- address: c:27017
8
+ tags:
9
+ data_center: nyc
10
+ - address: c:27017
13
11
  avg_rtt_ms: 100
14
12
  type: RSSecondary
15
- tag_sets:
16
- - data_center: nyc
13
+ tags:
14
+ data_center: nyc
17
15
  operation: read
18
16
  read_preference:
19
17
  mode: PrimaryPreferred
20
18
  tag_sets:
21
19
  - data_center: sf
22
- candidate_servers:
23
- - *1
24
- - *2
25
- eligible_servers: []
26
20
  suitable_servers: []
27
21
  in_latency_window: []
@@ -6,25 +6,19 @@ topology_description:
6
6
  address: b:27017
7
7
  avg_rtt_ms: 5
8
8
  type: RSSecondary
9
- tag_sets:
10
- - data_center: nyc
9
+ tags:
10
+ data_center: nyc
11
11
  - &2
12
12
  address: c:27017
13
13
  avg_rtt_ms: 100
14
14
  type: RSSecondary
15
- tag_sets:
16
- - data_center: nyc
15
+ tags:
16
+ data_center: nyc
17
17
  operation: read
18
18
  read_preference:
19
19
  mode: Secondary
20
20
  tag_sets:
21
21
  - data_center: nyc
22
- candidate_servers:
23
- - *1
24
- - *2
25
- eligible_servers:
26
- - *1
27
- - *2
28
22
  suitable_servers:
29
23
  - *1
30
24
  - *2
@@ -6,25 +6,19 @@ topology_description:
6
6
  address: b:27017
7
7
  avg_rtt_ms: 5
8
8
  type: RSSecondary
9
- tag_sets:
10
- - data_center: nyc
9
+ tags:
10
+ data_center: nyc
11
11
  - &2
12
12
  address: c:27017
13
13
  avg_rtt_ms: 100
14
14
  type: RSSecondary
15
- tag_sets:
16
- - data_center: nyc
15
+ tags:
16
+ data_center: nyc
17
17
  operation: read
18
18
  read_preference:
19
19
  mode: SecondaryPreferred
20
20
  tag_sets:
21
21
  - data_center: nyc
22
- candidate_servers:
23
- - *1
24
- - *2
25
- eligible_servers:
26
- - *1
27
- - *2
28
22
  suitable_servers:
29
23
  - *1
30
24
  - *2
@@ -2,26 +2,20 @@
2
2
  topology_description:
3
3
  type: ReplicaSetNoPrimary
4
4
  servers:
5
- - &1
6
- address: b:27017
5
+ - address: b:27017
7
6
  avg_rtt_ms: 5
8
7
  type: RSSecondary
9
- tag_sets:
10
- - data_center: nyc
11
- - &2
12
- address: c:27017
8
+ tags:
9
+ data_center: nyc
10
+ - address: c:27017
13
11
  avg_rtt_ms: 100
14
12
  type: RSSecondary
15
- tag_sets:
16
- - data_center: nyc
13
+ tags:
14
+ data_center: nyc
17
15
  operation: read
18
16
  read_preference:
19
17
  mode: SecondaryPreferred
20
18
  tag_sets:
21
19
  - data_center: sf
22
- candidate_servers:
23
- - *1
24
- - *2
25
- eligible_servers: []
26
20
  suitable_servers: []
27
21
  in_latency_window: []
@@ -2,26 +2,20 @@
2
2
  topology_description:
3
3
  type: ReplicaSetNoPrimary
4
4
  servers:
5
- - &1
6
- address: b:27017
5
+ - address: b:27017
7
6
  avg_rtt_ms: 5
8
7
  type: RSSecondary
9
- tag_sets:
10
- - data_center: nyc
11
- - &2
12
- address: c:27017
8
+ tags:
9
+ data_center: nyc
10
+ - address: c:27017
13
11
  avg_rtt_ms: 100
14
12
  type: RSSecondary
15
- tag_sets:
16
- - data_center: nyc
13
+ tags:
14
+ data_center: nyc
17
15
  operation: read
18
16
  read_preference:
19
17
  mode: Secondary
20
18
  tag_sets:
21
19
  - data_center: sf
22
- candidate_servers:
23
- - *1
24
- - *2
25
- eligible_servers: []
26
20
  suitable_servers: []
27
21
  in_latency_window: []
@@ -6,36 +6,28 @@ topology_description:
6
6
  address: b:27017
7
7
  avg_rtt_ms: 5
8
8
  type: RSSecondary
9
- tag_sets:
10
- - data_center: nyc
11
- - &2
9
+ tags:
10
+ data_center: nyc
11
+ - &3
12
12
  address: c:27017
13
13
  avg_rtt_ms: 100
14
14
  type: RSSecondary
15
- tag_sets:
16
- - data_center: nyc
17
- - &3
15
+ tags:
16
+ data_center: nyc
17
+ - &2
18
18
  address: a:27017
19
19
  avg_rtt_ms: 26
20
20
  type: RSPrimary
21
- tag_sets:
22
- - data_center: nyc
21
+ tags:
22
+ data_center: nyc
23
23
  operation: read
24
24
  read_preference:
25
25
  mode: Nearest
26
26
  tag_sets:
27
27
  - data_center: nyc
28
- candidate_servers:
29
- - *1
30
- - *2
31
- - *3
32
- eligible_servers:
33
- - *1
34
- - *2
35
- - *3
36
28
  suitable_servers:
37
29
  - *1
38
- - *3
39
30
  - *2
31
+ - *3
40
32
  in_latency_window:
41
33
  - *1