@@ -215,7 +215,8 @@ operations.set('createIndex', async ({ entities, operation }) => {
215
215
216
216
operations . set ( 'deleteOne' , async ( { entities, operation } ) => {
217
217
const collection = entities . getEntity ( 'collection' , operation . object ) ;
218
- return collection . deleteOne ( operation . arguments . filter ) ;
218
+ const { filter, ...options } = operation . arguments ;
219
+ return collection . deleteOne ( filter , options ) ;
219
220
} ) ;
220
221
221
222
operations . set ( 'dropCollection' , async ( { entities, operation } ) => {
@@ -230,8 +231,8 @@ operations.set('endSession', async ({ entities, operation }) => {
230
231
231
232
operations . set ( 'find' , async ( { entities, operation } ) => {
232
233
const collection = entities . getEntity ( 'collection' , operation . object ) ;
233
- const { filter, sort, batchSize, limit } = operation . arguments ;
234
- return collection . find ( filter , { sort, batchSize, limit } ) . toArray ( ) ;
234
+ const { filter, sort, batchSize, limit, let : vars } = operation . arguments ;
235
+ return collection . find ( filter , { sort, batchSize, limit, let : vars } ) . toArray ( ) ;
235
236
} ) ;
236
237
237
238
operations . set ( 'findOneAndReplace' , async ( { entities, operation } ) => {
@@ -398,12 +399,14 @@ operations.set('runCommand', async ({ entities, operation }: OperationFunctionPa
398
399
399
400
operations . set ( 'updateMany' , async ( { entities, operation } ) => {
400
401
const collection = entities . getEntity ( 'collection' , operation . object ) ;
401
- return collection . updateMany ( operation . arguments . filter , operation . arguments . update ) ;
402
+ const { filter, update, ...options } = operation . arguments ;
403
+ return collection . updateMany ( filter , update , options ) ;
402
404
} ) ;
403
405
404
406
operations . set ( 'updateOne' , async ( { entities, operation } ) => {
405
407
const collection = entities . getEntity ( 'collection' , operation . object ) ;
406
- return collection . updateOne ( operation . arguments . filter , operation . arguments . update ) ;
408
+ const { filter, update, ...options } = operation . arguments ;
409
+ return collection . updateOne ( filter , update , options ) ;
407
410
} ) ;
408
411
409
412
export async function executeOperationAndCheck (
0 commit comments