@@ -23,7 +23,7 @@ type WriteModel interface {
23
23
//
24
24
// See corresponding setter methods for documentation.
25
25
type InsertOneModel struct {
26
- Document interface {}
26
+ Document any
27
27
}
28
28
29
29
// NewInsertOneModel creates a new InsertOneModel.
@@ -34,7 +34,7 @@ func NewInsertOneModel() *InsertOneModel {
34
34
// SetDocument specifies the document to be inserted. The document cannot be nil. If it does not have an _id field when
35
35
// transformed into BSON, one will be added automatically to the marshalled document. The original document will not be
36
36
// modified.
37
- func (iom * InsertOneModel ) SetDocument (doc interface {} ) * InsertOneModel {
37
+ func (iom * InsertOneModel ) SetDocument (doc any ) * InsertOneModel {
38
38
iom .Document = doc
39
39
return iom
40
40
}
@@ -45,9 +45,9 @@ func (*InsertOneModel) writeModel() {}
45
45
//
46
46
// See corresponding setter methods for documentation.
47
47
type DeleteOneModel struct {
48
- Filter interface {}
48
+ Filter any
49
49
Collation * options.Collation
50
- Hint interface {}
50
+ Hint any
51
51
}
52
52
53
53
// NewDeleteOneModel creates a new DeleteOneModel.
@@ -58,7 +58,7 @@ func NewDeleteOneModel() *DeleteOneModel {
58
58
// SetFilter specifies a filter to use to select the document to delete. The filter must be a document containing query
59
59
// operators. It cannot be nil. If the filter matches multiple documents, one will be selected from the matching
60
60
// documents.
61
- func (dom * DeleteOneModel ) SetFilter (filter interface {} ) * DeleteOneModel {
61
+ func (dom * DeleteOneModel ) SetFilter (filter any ) * DeleteOneModel {
62
62
dom .Filter = filter
63
63
return dom
64
64
}
@@ -77,7 +77,7 @@ func (dom *DeleteOneModel) SetCollation(collation *options.Collation) *DeleteOne
77
77
// if this option is specified during an unacknowledged write operation. The
78
78
// driver will return an error if the hint parameter is a multi-key map. The
79
79
// default value is nil, which means that no hint will be sent.
80
- func (dom * DeleteOneModel ) SetHint (hint interface {} ) * DeleteOneModel {
80
+ func (dom * DeleteOneModel ) SetHint (hint any ) * DeleteOneModel {
81
81
dom .Hint = hint
82
82
return dom
83
83
}
@@ -88,9 +88,9 @@ func (*DeleteOneModel) writeModel() {}
88
88
//
89
89
// See corresponding setter methods for documentation.
90
90
type DeleteManyModel struct {
91
- Filter interface {}
91
+ Filter any
92
92
Collation * options.Collation
93
- Hint interface {}
93
+ Hint any
94
94
}
95
95
96
96
// NewDeleteManyModel creates a new DeleteManyModel.
@@ -100,7 +100,7 @@ func NewDeleteManyModel() *DeleteManyModel {
100
100
101
101
// SetFilter specifies a filter to use to select documents to delete. The filter must be a document containing query
102
102
// operators. It cannot be nil.
103
- func (dmm * DeleteManyModel ) SetFilter (filter interface {} ) * DeleteManyModel {
103
+ func (dmm * DeleteManyModel ) SetFilter (filter any ) * DeleteManyModel {
104
104
dmm .Filter = filter
105
105
return dmm
106
106
}
@@ -119,7 +119,7 @@ func (dmm *DeleteManyModel) SetCollation(collation *options.Collation) *DeleteMa
119
119
// if this option is specified during an unacknowledged write operation. The
120
120
// driver will return an error if the hint parameter is a multi-key map. The
121
121
// default value is nil, which means that no hint will be sent.
122
- func (dmm * DeleteManyModel ) SetHint (hint interface {} ) * DeleteManyModel {
122
+ func (dmm * DeleteManyModel ) SetHint (hint any ) * DeleteManyModel {
123
123
dmm .Hint = hint
124
124
return dmm
125
125
}
@@ -132,10 +132,10 @@ func (*DeleteManyModel) writeModel() {}
132
132
type ReplaceOneModel struct {
133
133
Collation * options.Collation
134
134
Upsert * bool
135
- Filter interface {}
136
- Replacement interface {}
137
- Hint interface {}
138
- Sort interface {}
135
+ Filter any
136
+ Replacement any
137
+ Hint any
138
+ Sort any
139
139
}
140
140
141
141
// NewReplaceOneModel creates a new ReplaceOneModel.
@@ -150,22 +150,22 @@ func NewReplaceOneModel() *ReplaceOneModel {
150
150
// if this option is specified during an unacknowledged write operation. The
151
151
// driver will return an error if the hint parameter is a multi-key map. The
152
152
// default value is nil, which means that no hint will be sent.
153
- func (rom * ReplaceOneModel ) SetHint (hint interface {} ) * ReplaceOneModel {
153
+ func (rom * ReplaceOneModel ) SetHint (hint any ) * ReplaceOneModel {
154
154
rom .Hint = hint
155
155
return rom
156
156
}
157
157
158
158
// SetFilter specifies a filter to use to select the document to replace. The filter must be a document containing query
159
159
// operators. It cannot be nil. If the filter matches multiple documents, one will be selected from the matching
160
160
// documents.
161
- func (rom * ReplaceOneModel ) SetFilter (filter interface {} ) * ReplaceOneModel {
161
+ func (rom * ReplaceOneModel ) SetFilter (filter any ) * ReplaceOneModel {
162
162
rom .Filter = filter
163
163
return rom
164
164
}
165
165
166
166
// SetReplacement specifies a document that will be used to replace the selected document. It cannot be nil and cannot
167
167
// contain any update operators (https://www.mongodb.com/docs/manual/reference/operator/update/).
168
- func (rom * ReplaceOneModel ) SetReplacement (rep interface {} ) * ReplaceOneModel {
168
+ func (rom * ReplaceOneModel ) SetReplacement (rep any ) * ReplaceOneModel {
169
169
rom .Replacement = rep
170
170
return rom
171
171
}
@@ -189,7 +189,7 @@ func (rom *ReplaceOneModel) SetUpsert(upsert bool) *ReplaceOneModel {
189
189
// matched by the sort order will be replaced. This option is only valid for MongoDB versions >= 8.0. The sort parameter
190
190
// is evaluated sequentially, so the driver will return an error if it is a multi-key map (which is unordeded). The
191
191
// default value is nil.
192
- func (rom * ReplaceOneModel ) SetSort (sort interface {} ) * ReplaceOneModel {
192
+ func (rom * ReplaceOneModel ) SetSort (sort any ) * ReplaceOneModel {
193
193
rom .Sort = sort
194
194
return rom
195
195
}
@@ -202,11 +202,11 @@ func (*ReplaceOneModel) writeModel() {}
202
202
type UpdateOneModel struct {
203
203
Collation * options.Collation
204
204
Upsert * bool
205
- Filter interface {}
206
- Update interface {}
207
- ArrayFilters []interface {}
208
- Hint interface {}
209
- Sort interface {}
205
+ Filter any
206
+ Update any
207
+ ArrayFilters []any
208
+ Hint any
209
+ Sort any
210
210
}
211
211
212
212
// NewUpdateOneModel creates a new UpdateOneModel.
@@ -221,29 +221,29 @@ func NewUpdateOneModel() *UpdateOneModel {
221
221
// if this option is specified during an unacknowledged write operation. The
222
222
// driver will return an error if the hint parameter is a multi-key map. The
223
223
// default value is nil, which means that no hint will be sent.
224
- func (uom * UpdateOneModel ) SetHint (hint interface {} ) * UpdateOneModel {
224
+ func (uom * UpdateOneModel ) SetHint (hint any ) * UpdateOneModel {
225
225
uom .Hint = hint
226
226
return uom
227
227
}
228
228
229
229
// SetFilter specifies a filter to use to select the document to update. The filter must be a document containing query
230
230
// operators. It cannot be nil. If the filter matches multiple documents, one will be selected from the matching
231
231
// documents.
232
- func (uom * UpdateOneModel ) SetFilter (filter interface {} ) * UpdateOneModel {
232
+ func (uom * UpdateOneModel ) SetFilter (filter any ) * UpdateOneModel {
233
233
uom .Filter = filter
234
234
return uom
235
235
}
236
236
237
237
// SetUpdate specifies the modifications to be made to the selected document. The value must be a document containing
238
238
// update operators (https://www.mongodb.com/docs/manual/reference/operator/update/). It cannot be nil or empty.
239
- func (uom * UpdateOneModel ) SetUpdate (update interface {} ) * UpdateOneModel {
239
+ func (uom * UpdateOneModel ) SetUpdate (update any ) * UpdateOneModel {
240
240
uom .Update = update
241
241
return uom
242
242
}
243
243
244
244
// SetArrayFilters specifies a set of filters to determine which elements should be modified when updating an array
245
245
// field.
246
- func (uom * UpdateOneModel ) SetArrayFilters (filters []interface {} ) * UpdateOneModel {
246
+ func (uom * UpdateOneModel ) SetArrayFilters (filters []any ) * UpdateOneModel {
247
247
uom .ArrayFilters = filters
248
248
return uom
249
249
}
@@ -267,7 +267,7 @@ func (uom *UpdateOneModel) SetUpsert(upsert bool) *UpdateOneModel {
267
267
// matched by the sort order will be updated. This option is only valid for MongoDB versions >= 8.0. The sort parameter
268
268
// is evaluated sequentially, so the driver will return an error if it is a multi-key map (which is unordeded). The
269
269
// default value is nil.
270
- func (uom * UpdateOneModel ) SetSort (sort interface {} ) * UpdateOneModel {
270
+ func (uom * UpdateOneModel ) SetSort (sort any ) * UpdateOneModel {
271
271
uom .Sort = sort
272
272
return uom
273
273
}
@@ -280,10 +280,10 @@ func (*UpdateOneModel) writeModel() {}
280
280
type UpdateManyModel struct {
281
281
Collation * options.Collation
282
282
Upsert * bool
283
- Filter interface {}
284
- Update interface {}
285
- ArrayFilters []interface {}
286
- Hint interface {}
283
+ Filter any
284
+ Update any
285
+ ArrayFilters []any
286
+ Hint any
287
287
}
288
288
289
289
// NewUpdateManyModel creates a new UpdateManyModel.
@@ -298,28 +298,28 @@ func NewUpdateManyModel() *UpdateManyModel {
298
298
// if this option is specified during an unacknowledged write operation. The
299
299
// driver will return an error if the hint parameter is a multi-key map. The
300
300
// default value is nil, which means that no hint will be sent.
301
- func (umm * UpdateManyModel ) SetHint (hint interface {} ) * UpdateManyModel {
301
+ func (umm * UpdateManyModel ) SetHint (hint any ) * UpdateManyModel {
302
302
umm .Hint = hint
303
303
return umm
304
304
}
305
305
306
306
// SetFilter specifies a filter to use to select documents to update. The filter must be a document containing query
307
307
// operators. It cannot be nil.
308
- func (umm * UpdateManyModel ) SetFilter (filter interface {} ) * UpdateManyModel {
308
+ func (umm * UpdateManyModel ) SetFilter (filter any ) * UpdateManyModel {
309
309
umm .Filter = filter
310
310
return umm
311
311
}
312
312
313
313
// SetUpdate specifies the modifications to be made to the selected documents. The value must be a document containing
314
314
// update operators (https://www.mongodb.com/docs/manual/reference/operator/update/). It cannot be nil or empty.
315
- func (umm * UpdateManyModel ) SetUpdate (update interface {} ) * UpdateManyModel {
315
+ func (umm * UpdateManyModel ) SetUpdate (update any ) * UpdateManyModel {
316
316
umm .Update = update
317
317
return umm
318
318
}
319
319
320
320
// SetArrayFilters specifies a set of filters to determine which elements should be modified when updating an array
321
321
// field.
322
- func (umm * UpdateManyModel ) SetArrayFilters (filters []interface {} ) * UpdateManyModel {
322
+ func (umm * UpdateManyModel ) SetArrayFilters (filters []any ) * UpdateManyModel {
323
323
umm .ArrayFilters = filters
324
324
return umm
325
325
}
0 commit comments