File tree Expand file tree Collapse file tree 5 files changed +57
-8
lines changed Expand file tree Collapse file tree 5 files changed +57
-8
lines changed Original file line number Diff line number Diff line change @@ -423,6 +423,11 @@ def get_more_operation
423
423
else
424
424
nil
425
425
end ,
426
+ comment : if view . respond_to? ( :options ) && view . options . is_a? ( Hash )
427
+ view . options [ :comment ]
428
+ else
429
+ nil
430
+ end ,
426
431
}
427
432
Operation ::GetMore . new ( spec )
428
433
end
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ def selector(connection)
30
30
collection : spec . fetch ( :coll_name ) ,
31
31
batchSize : spec [ :batch_size ] ,
32
32
maxTimeMS : spec [ :max_time_ms ] ,
33
+ comment : spec [ :comment ] ,
33
34
} . compact
34
35
end
35
36
end
Original file line number Diff line number Diff line change @@ -136,3 +136,44 @@ tests:
136
136
pipeline :
137
137
- $changeStream : {}
138
138
comment : " comment"
139
+
140
+ - description : " Test that comment is set on getMore"
141
+ runOnRequirements :
142
+ - minServerVersion : " 4.4.0"
143
+ topologies : [ single, replicaset ]
144
+ operations :
145
+ - name : createChangeStream
146
+ object : *collection0
147
+ arguments :
148
+ pipeline : []
149
+ comment : " comment"
150
+ saveResultAsEntity : &changeStream0 changeStream0
151
+ - name : insertOne
152
+ object : *collection0
153
+ arguments :
154
+ document : &new_document
155
+ _id : 1
156
+ a : 1
157
+ - name : iterateUntilDocumentOrError
158
+ object : *changeStream0
159
+ expectEvents :
160
+ - client : *client0
161
+ events :
162
+ - commandStartedEvent :
163
+ command :
164
+ aggregate : *collection0
165
+ pipeline :
166
+ - $changeStream : {}
167
+ comment : " comment"
168
+ - commandStartedEvent :
169
+ command :
170
+ insert : *collection0
171
+ documents :
172
+ - *new_document
173
+ - commandStartedEvent :
174
+ command :
175
+ getMore : { $$type: [ int, long ] }
176
+ collection : *collection0
177
+ comment : " comment"
178
+ commandName : getMore
179
+ databaseName : *database0
Original file line number Diff line number Diff line change @@ -125,9 +125,10 @@ tests:
125
125
commandName : aggregate
126
126
databaseName : *database0Name
127
127
128
- - description : " aggregate with comment does not set comment on getMore"
128
+ - description : " aggregate with comment sets comment on getMore"
129
129
runOnRequirements :
130
- - minServerVersion : " 3.6.0"
130
+ - minServerVersion : " 4.4.0"
131
+ topologies : [ single, replicaset ]
131
132
operations :
132
133
- name : aggregate
133
134
arguments :
@@ -157,14 +158,14 @@ tests:
157
158
getMore : { $$type: [ int, long ] }
158
159
collection : *collection0Name
159
160
batchSize : 2
160
- comment : { $$exists: false }
161
+ comment : " comment "
161
162
commandName : getMore
162
163
databaseName : *database0Name
163
164
- commandStartedEvent :
164
165
command :
165
166
getMore : { $$type: [ int, long ] }
166
167
collection : *collection0Name
167
168
batchSize : 2
168
- comment : { $$exists: false }
169
+ comment : " comment "
169
170
commandName : getMore
170
171
databaseName : *database0Name
Original file line number Diff line number Diff line change @@ -88,9 +88,10 @@ tests:
88
88
filter : *filter
89
89
comment : *comment
90
90
91
- - description : " find with comment does not set comment on getMore"
91
+ - description : " find with comment sets comment on getMore"
92
92
runOnRequirements :
93
- - minServerVersion : " 3.6"
93
+ - minServerVersion : " 4.4.0"
94
+ topologies : [ single, replicaset ]
94
95
operations :
95
96
- name : find
96
97
object : *collection0
@@ -118,10 +119,10 @@ tests:
118
119
getMore : { $$type: [ int, long ] }
119
120
collection : *collection0Name
120
121
batchSize : 2
121
- comment : { $$exists: false }
122
+ comment : " comment "
122
123
- commandStartedEvent :
123
124
command :
124
125
getMore : { $$type: [ int, long ] }
125
126
collection : *collection0Name
126
127
batchSize : 2
127
- comment : { $$exists: false }
128
+ comment : " comment "
You can’t perform that action at this time.
0 commit comments