@@ -23,7 +23,7 @@ type WriteModel interface {
2323//
2424// See corresponding setter methods for documentation.
2525type InsertOneModel struct {
26- Document interface {}
26+ Document any
2727}
2828
2929// NewInsertOneModel creates a new InsertOneModel.
@@ -34,7 +34,7 @@ func NewInsertOneModel() *InsertOneModel {
3434// SetDocument specifies the document to be inserted. The document cannot be nil. If it does not have an _id field when
3535// transformed into BSON, one will be added automatically to the marshalled document. The original document will not be
3636// modified.
37- func (iom * InsertOneModel ) SetDocument (doc interface {} ) * InsertOneModel {
37+ func (iom * InsertOneModel ) SetDocument (doc any ) * InsertOneModel {
3838 iom .Document = doc
3939 return iom
4040}
@@ -45,9 +45,9 @@ func (*InsertOneModel) writeModel() {}
4545//
4646// See corresponding setter methods for documentation.
4747type DeleteOneModel struct {
48- Filter interface {}
48+ Filter any
4949 Collation * options.Collation
50- Hint interface {}
50+ Hint any
5151}
5252
5353// NewDeleteOneModel creates a new DeleteOneModel.
@@ -58,7 +58,7 @@ func NewDeleteOneModel() *DeleteOneModel {
5858// SetFilter specifies a filter to use to select the document to delete. The filter must be a document containing query
5959// operators. It cannot be nil. If the filter matches multiple documents, one will be selected from the matching
6060// documents.
61- func (dom * DeleteOneModel ) SetFilter (filter interface {} ) * DeleteOneModel {
61+ func (dom * DeleteOneModel ) SetFilter (filter any ) * DeleteOneModel {
6262 dom .Filter = filter
6363 return dom
6464}
@@ -77,7 +77,7 @@ func (dom *DeleteOneModel) SetCollation(collation *options.Collation) *DeleteOne
7777// if this option is specified during an unacknowledged write operation. The
7878// driver will return an error if the hint parameter is a multi-key map. The
7979// 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 {
8181 dom .Hint = hint
8282 return dom
8383}
@@ -88,9 +88,9 @@ func (*DeleteOneModel) writeModel() {}
8888//
8989// See corresponding setter methods for documentation.
9090type DeleteManyModel struct {
91- Filter interface {}
91+ Filter any
9292 Collation * options.Collation
93- Hint interface {}
93+ Hint any
9494}
9595
9696// NewDeleteManyModel creates a new DeleteManyModel.
@@ -100,7 +100,7 @@ func NewDeleteManyModel() *DeleteManyModel {
100100
101101// SetFilter specifies a filter to use to select documents to delete. The filter must be a document containing query
102102// operators. It cannot be nil.
103- func (dmm * DeleteManyModel ) SetFilter (filter interface {} ) * DeleteManyModel {
103+ func (dmm * DeleteManyModel ) SetFilter (filter any ) * DeleteManyModel {
104104 dmm .Filter = filter
105105 return dmm
106106}
@@ -119,7 +119,7 @@ func (dmm *DeleteManyModel) SetCollation(collation *options.Collation) *DeleteMa
119119// if this option is specified during an unacknowledged write operation. The
120120// driver will return an error if the hint parameter is a multi-key map. The
121121// 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 {
123123 dmm .Hint = hint
124124 return dmm
125125}
@@ -132,10 +132,10 @@ func (*DeleteManyModel) writeModel() {}
132132type ReplaceOneModel struct {
133133 Collation * options.Collation
134134 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
139139}
140140
141141// NewReplaceOneModel creates a new ReplaceOneModel.
@@ -150,22 +150,22 @@ func NewReplaceOneModel() *ReplaceOneModel {
150150// if this option is specified during an unacknowledged write operation. The
151151// driver will return an error if the hint parameter is a multi-key map. The
152152// 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 {
154154 rom .Hint = hint
155155 return rom
156156}
157157
158158// SetFilter specifies a filter to use to select the document to replace. The filter must be a document containing query
159159// operators. It cannot be nil. If the filter matches multiple documents, one will be selected from the matching
160160// documents.
161- func (rom * ReplaceOneModel ) SetFilter (filter interface {} ) * ReplaceOneModel {
161+ func (rom * ReplaceOneModel ) SetFilter (filter any ) * ReplaceOneModel {
162162 rom .Filter = filter
163163 return rom
164164}
165165
166166// SetReplacement specifies a document that will be used to replace the selected document. It cannot be nil and cannot
167167// 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 {
169169 rom .Replacement = rep
170170 return rom
171171}
@@ -189,7 +189,7 @@ func (rom *ReplaceOneModel) SetUpsert(upsert bool) *ReplaceOneModel {
189189// matched by the sort order will be replaced. This option is only valid for MongoDB versions >= 8.0. The sort parameter
190190// is evaluated sequentially, so the driver will return an error if it is a multi-key map (which is unordeded). The
191191// default value is nil.
192- func (rom * ReplaceOneModel ) SetSort (sort interface {} ) * ReplaceOneModel {
192+ func (rom * ReplaceOneModel ) SetSort (sort any ) * ReplaceOneModel {
193193 rom .Sort = sort
194194 return rom
195195}
@@ -202,11 +202,11 @@ func (*ReplaceOneModel) writeModel() {}
202202type UpdateOneModel struct {
203203 Collation * options.Collation
204204 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
210210}
211211
212212// NewUpdateOneModel creates a new UpdateOneModel.
@@ -221,29 +221,29 @@ func NewUpdateOneModel() *UpdateOneModel {
221221// if this option is specified during an unacknowledged write operation. The
222222// driver will return an error if the hint parameter is a multi-key map. The
223223// 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 {
225225 uom .Hint = hint
226226 return uom
227227}
228228
229229// SetFilter specifies a filter to use to select the document to update. The filter must be a document containing query
230230// operators. It cannot be nil. If the filter matches multiple documents, one will be selected from the matching
231231// documents.
232- func (uom * UpdateOneModel ) SetFilter (filter interface {} ) * UpdateOneModel {
232+ func (uom * UpdateOneModel ) SetFilter (filter any ) * UpdateOneModel {
233233 uom .Filter = filter
234234 return uom
235235}
236236
237237// SetUpdate specifies the modifications to be made to the selected document. The value must be a document containing
238238// 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 {
240240 uom .Update = update
241241 return uom
242242}
243243
244244// SetArrayFilters specifies a set of filters to determine which elements should be modified when updating an array
245245// field.
246- func (uom * UpdateOneModel ) SetArrayFilters (filters []interface {} ) * UpdateOneModel {
246+ func (uom * UpdateOneModel ) SetArrayFilters (filters []any ) * UpdateOneModel {
247247 uom .ArrayFilters = filters
248248 return uom
249249}
@@ -267,7 +267,7 @@ func (uom *UpdateOneModel) SetUpsert(upsert bool) *UpdateOneModel {
267267// matched by the sort order will be updated. This option is only valid for MongoDB versions >= 8.0. The sort parameter
268268// is evaluated sequentially, so the driver will return an error if it is a multi-key map (which is unordeded). The
269269// default value is nil.
270- func (uom * UpdateOneModel ) SetSort (sort interface {} ) * UpdateOneModel {
270+ func (uom * UpdateOneModel ) SetSort (sort any ) * UpdateOneModel {
271271 uom .Sort = sort
272272 return uom
273273}
@@ -280,10 +280,10 @@ func (*UpdateOneModel) writeModel() {}
280280type UpdateManyModel struct {
281281 Collation * options.Collation
282282 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
287287}
288288
289289// NewUpdateManyModel creates a new UpdateManyModel.
@@ -298,28 +298,28 @@ func NewUpdateManyModel() *UpdateManyModel {
298298// if this option is specified during an unacknowledged write operation. The
299299// driver will return an error if the hint parameter is a multi-key map. The
300300// 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 {
302302 umm .Hint = hint
303303 return umm
304304}
305305
306306// SetFilter specifies a filter to use to select documents to update. The filter must be a document containing query
307307// operators. It cannot be nil.
308- func (umm * UpdateManyModel ) SetFilter (filter interface {} ) * UpdateManyModel {
308+ func (umm * UpdateManyModel ) SetFilter (filter any ) * UpdateManyModel {
309309 umm .Filter = filter
310310 return umm
311311}
312312
313313// SetUpdate specifies the modifications to be made to the selected documents. The value must be a document containing
314314// 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 {
316316 umm .Update = update
317317 return umm
318318}
319319
320320// SetArrayFilters specifies a set of filters to determine which elements should be modified when updating an array
321321// field.
322- func (umm * UpdateManyModel ) SetArrayFilters (filters []interface {} ) * UpdateManyModel {
322+ func (umm * UpdateManyModel ) SetArrayFilters (filters []any ) * UpdateManyModel {
323323 umm .ArrayFilters = filters
324324 return umm
325325}
0 commit comments