@@ -79,7 +79,7 @@ func TestDeleter_e2e_DeleteOne(t *testing.T) {
79
79
after func (ctx context.Context , t * testing.T )
80
80
81
81
filter bson.D
82
- opts []options.Lister [options.DeleteOptions ]
82
+ opts []options.Lister [options.DeleteOneOptions ]
83
83
globalHook []globalHook
84
84
beforeHook []beforeHookFn
85
85
afterHook []afterHookFn
@@ -94,7 +94,7 @@ func TestDeleter_e2e_DeleteOne(t *testing.T) {
94
94
after : func (_ context.Context , _ * testing.T ) {},
95
95
filter : nil ,
96
96
ctx : context .Background (),
97
- opts : []options.Lister [options.DeleteOptions ]{options .Delete ().SetComment ("test" )},
97
+ opts : []options.Lister [options.DeleteOneOptions ]{options .DeleteOne ().SetComment ("test" )},
98
98
want : nil ,
99
99
wantError : require .Error ,
100
100
},
@@ -112,7 +112,7 @@ func TestDeleter_e2e_DeleteOne(t *testing.T) {
112
112
},
113
113
filter : query .NewBuilder ().Id ("2" ).Build (),
114
114
ctx : context .Background (),
115
- opts : []options.Lister [options.DeleteOptions ]{options .Delete ().SetComment ("test" )},
115
+ opts : []options.Lister [options.DeleteOneOptions ]{options .DeleteOne ().SetComment ("test" )},
116
116
want : & mongo.DeleteResult {
117
117
DeletedCount : 0 ,
118
118
Acknowledged : true ,
@@ -133,7 +133,7 @@ func TestDeleter_e2e_DeleteOne(t *testing.T) {
133
133
},
134
134
filter : query .NewBuilder ().Id ("1" ).Build (),
135
135
ctx : context .Background (),
136
- opts : []options.Lister [options.DeleteOptions ]{options .Delete ().SetComment ("test" )},
136
+ opts : []options.Lister [options.DeleteOneOptions ]{options .DeleteOne ().SetComment ("test" )},
137
137
want : & mongo.DeleteResult {
138
138
DeletedCount : 1 ,
139
139
Acknowledged : true ,
@@ -146,7 +146,7 @@ func TestDeleter_e2e_DeleteOne(t *testing.T) {
146
146
after : func (ctx context.Context , t * testing.T ) {},
147
147
filter : query .NewBuilder ().Id ("1" ).Build (),
148
148
ctx : context .Background (),
149
- opts : []options.Lister [options.DeleteOptions ]{options .Delete ().SetComment ("test" )},
149
+ opts : []options.Lister [options.DeleteOneOptions ]{options .DeleteOne ().SetComment ("test" )},
150
150
globalHook : []globalHook {
151
151
{
152
152
opType : operation .OpTypeBeforeDelete ,
@@ -167,7 +167,7 @@ func TestDeleter_e2e_DeleteOne(t *testing.T) {
167
167
after : func (ctx context.Context , t * testing.T ) {},
168
168
filter : query .NewBuilder ().Id ("1" ).Build (),
169
169
ctx : context .Background (),
170
- opts : []options.Lister [options.DeleteOptions ]{options .Delete ().SetComment ("test" )},
170
+ opts : []options.Lister [options.DeleteOneOptions ]{options .DeleteOne ().SetComment ("test" )},
171
171
globalHook : []globalHook {
172
172
{
173
173
opType : operation .OpTypeAfterDelete ,
@@ -196,7 +196,7 @@ func TestDeleter_e2e_DeleteOne(t *testing.T) {
196
196
},
197
197
filter : query .NewBuilder ().Id ("1" ).Build (),
198
198
ctx : context .Background (),
199
- opts : []options.Lister [options.DeleteOptions ]{options .Delete ().SetComment ("test" )},
199
+ opts : []options.Lister [options.DeleteOneOptions ]{options .DeleteOne ().SetComment ("test" )},
200
200
globalHook : []globalHook {
201
201
{
202
202
opType : operation .OpTypeBeforeDelete ,
@@ -231,7 +231,7 @@ func TestDeleter_e2e_DeleteOne(t *testing.T) {
231
231
after : func (ctx context.Context , t * testing.T ) {},
232
232
filter : query .NewBuilder ().Id ("1" ).Build (),
233
233
ctx : context .Background (),
234
- opts : []options.Lister [options.DeleteOptions ]{options .Delete ().SetComment ("test" )},
234
+ opts : []options.Lister [options.DeleteOneOptions ]{options .DeleteOne ().SetComment ("test" )},
235
235
beforeHook : []beforeHookFn {
236
236
func (ctx context.Context , opCtx * OpContext , opts ... any ) error {
237
237
return fmt .Errorf ("before hook error" )
@@ -248,7 +248,7 @@ func TestDeleter_e2e_DeleteOne(t *testing.T) {
248
248
after : func (ctx context.Context , t * testing.T ) {},
249
249
filter : query .NewBuilder ().Id ("1" ).Build (),
250
250
ctx : context .Background (),
251
- opts : []options.Lister [options.DeleteOptions ]{options .Delete ().SetComment ("test" )},
251
+ opts : []options.Lister [options.DeleteOneOptions ]{options .DeleteOne ().SetComment ("test" )},
252
252
afterHook : []afterHookFn {
253
253
func (ctx context.Context , opCtx * OpContext , opts ... any ) error {
254
254
return fmt .Errorf ("after hook error" )
@@ -273,7 +273,7 @@ func TestDeleter_e2e_DeleteOne(t *testing.T) {
273
273
},
274
274
filter : query .NewBuilder ().Id ("1" ).Build (),
275
275
ctx : context .Background (),
276
- opts : []options.Lister [options.DeleteOptions ]{options .Delete ().SetComment ("test" )},
276
+ opts : []options.Lister [options.DeleteOneOptions ]{options .DeleteOne ().SetComment ("test" )},
277
277
beforeHook : []beforeHookFn {
278
278
func (ctx context.Context , opCtx * OpContext , opts ... any ) error {
279
279
if opCtx .Filter == nil {
@@ -332,7 +332,7 @@ func TestDeleter_e2e_DeleteMany(t *testing.T) {
332
332
after func (ctx context.Context , t * testing.T )
333
333
334
334
filter any
335
- opts []options.Lister [options.DeleteOptions ]
335
+ opts []options.Lister [options.DeleteManyOptions ]
336
336
globalHook []globalHook
337
337
beforeHook []beforeHookFn
338
338
afterHook []afterHookFn
@@ -347,7 +347,7 @@ func TestDeleter_e2e_DeleteMany(t *testing.T) {
347
347
after : func (_ context.Context , _ * testing.T ) {},
348
348
filter : nil ,
349
349
ctx : context .Background (),
350
- opts : []options.Lister [options.DeleteOptions ]{options .Delete ().SetComment ("test" )},
350
+ opts : []options.Lister [options.DeleteManyOptions ]{options .DeleteMany ().SetComment ("test" )},
351
351
want : nil ,
352
352
wantError : require .Error ,
353
353
},
@@ -368,7 +368,7 @@ func TestDeleter_e2e_DeleteMany(t *testing.T) {
368
368
},
369
369
filter : bsonx .Id ("789" ),
370
370
ctx : context .Background (),
371
- opts : []options.Lister [options.DeleteOptions ]{options .Delete ().SetComment ("test" )},
371
+ opts : []options.Lister [options.DeleteManyOptions ]{options .DeleteMany ().SetComment ("test" )},
372
372
want : & mongo.DeleteResult {
373
373
DeletedCount : 0 ,
374
374
Acknowledged : true ,
@@ -392,7 +392,7 @@ func TestDeleter_e2e_DeleteMany(t *testing.T) {
392
392
},
393
393
filter : bsonx .M ("name" , "Mingyong Chen" ),
394
394
ctx : context .Background (),
395
- opts : []options.Lister [options.DeleteOptions ]{options .Delete ().SetComment ("test" )},
395
+ opts : []options.Lister [options.DeleteManyOptions ]{options .DeleteMany ().SetComment ("test" )},
396
396
want : & mongo.DeleteResult {
397
397
DeletedCount : 2 ,
398
398
Acknowledged : true ,
@@ -405,7 +405,7 @@ func TestDeleter_e2e_DeleteMany(t *testing.T) {
405
405
after : func (ctx context.Context , t * testing.T ) {},
406
406
filter : bsonx .Id ("789" ),
407
407
ctx : context .Background (),
408
- opts : []options.Lister [options.DeleteOptions ]{options .Delete ().SetComment ("test" )},
408
+ opts : []options.Lister [options.DeleteManyOptions ]{options .DeleteMany ().SetComment ("test" )},
409
409
globalHook : []globalHook {
410
410
{
411
411
opType : operation .OpTypeBeforeDelete ,
@@ -446,7 +446,7 @@ func TestDeleter_e2e_DeleteMany(t *testing.T) {
446
446
},
447
447
filter : bsonx .Id ("789" ),
448
448
ctx : context .Background (),
449
- opts : []options.Lister [options.DeleteOptions ]{options .Delete ().SetComment ("test" )},
449
+ opts : []options.Lister [options.DeleteManyOptions ]{options .DeleteMany ().SetComment ("test" )},
450
450
want : nil ,
451
451
wantError : func (t require.TestingT , err error , i ... interface {}) {
452
452
require .Equal (t , "after hook error" , err .Error ())
@@ -491,7 +491,7 @@ func TestDeleter_e2e_DeleteMany(t *testing.T) {
491
491
},
492
492
filter : query .In ("_id" , "1" , "2" ),
493
493
ctx : context .Background (),
494
- opts : []options.Lister [options.DeleteOptions ]{options .Delete ().SetComment ("test" )},
494
+ opts : []options.Lister [options.DeleteManyOptions ]{options .DeleteMany ().SetComment ("test" )},
495
495
want : & mongo.DeleteResult {
496
496
DeletedCount : 2 ,
497
497
Acknowledged : true ,
@@ -504,7 +504,7 @@ func TestDeleter_e2e_DeleteMany(t *testing.T) {
504
504
after : func (ctx context.Context , t * testing.T ) {},
505
505
filter : bsonx .Id ("789" ),
506
506
ctx : context .Background (),
507
- opts : []options.Lister [options.DeleteOptions ]{options .Delete ().SetComment ("test" )},
507
+ opts : []options.Lister [options.DeleteManyOptions ]{options .DeleteMany ().SetComment ("test" )},
508
508
beforeHook : []beforeHookFn {
509
509
func (ctx context.Context , opCtx * OpContext , opts ... any ) error {
510
510
return fmt .Errorf ("before hook error" )
@@ -537,7 +537,7 @@ func TestDeleter_e2e_DeleteMany(t *testing.T) {
537
537
},
538
538
filter : query .In ("_id" , "1" , "2" ),
539
539
ctx : context .Background (),
540
- opts : []options.Lister [options.DeleteOptions ]{options .Delete ().SetComment ("test" )},
540
+ opts : []options.Lister [options.DeleteManyOptions ]{options .DeleteMany ().SetComment ("test" )},
541
541
want : nil ,
542
542
wantError : func (t require.TestingT , err error , i ... interface {}) {
543
543
require .Equal (t , "after hook error" , err .Error ())
@@ -576,7 +576,7 @@ func TestDeleter_e2e_DeleteMany(t *testing.T) {
576
576
},
577
577
filter : query .In ("_id" , "1" , "2" ),
578
578
ctx : context .Background (),
579
- opts : []options.Lister [options.DeleteOptions ]{options .Delete ().SetComment ("test" )},
579
+ opts : []options.Lister [options.DeleteManyOptions ]{options .DeleteMany ().SetComment ("test" )},
580
580
want : & mongo.DeleteResult {
581
581
DeletedCount : 2 ,
582
582
Acknowledged : true ,
0 commit comments