@@ -30,6 +30,9 @@ describe('Testing of the collection.data methods with a single target reference'
3030 const toBeUpdatedID = v4 ( ) ;
3131 const toBeDeletedID = v4 ( ) ;
3232 const nonExistingID = v4 ( ) ;
33+ const deleteManyFirstID = v4 ( ) ;
34+ const deleteManySecondID = v4 ( ) ;
35+ const deleteManyThirdID = v4 ( ) ;
3336
3437 beforeAll ( async ( ) => {
3538 client = await weaviate . connectToLocal ( ) ;
@@ -78,9 +81,9 @@ describe('Testing of the collection.data methods with a single target reference'
7881 id : toBeDeletedID ,
7982 } ) ;
8083 return collection . data . insertMany ( [
81- { properties : { testProp : 'DELETE ME' } } ,
82- { properties : { testProp : 'DELETE ME' } } ,
83- { properties : { testProp : 'DELETE ME' } } ,
84+ { properties : { testProp : 'DELETE ME' } , id : deleteManyFirstID } ,
85+ { properties : { testProp : 'DELETE ME' } , id : deleteManySecondID } ,
86+ { properties : { testProp : 'DELETE ME' } , id : deleteManyThirdID } ,
8487 {
8588 properties : {
8689 testProp : 'EXISTING' ,
@@ -149,6 +152,22 @@ describe('Testing of the collection.data methods with a single target reference'
149152 expect ( obj ) . toBeNull ( ) ;
150153 } ) ;
151154
155+ it ( 'should be able to dryRun delete many objects with a filter' , async ( ) => {
156+ const result = await collection . data . deleteMany (
157+ collection . filter . byProperty ( 'testProp' ) . equal ( 'DELETE ME' ) ,
158+ {
159+ dryRun : true ,
160+ verbose : true ,
161+ }
162+ ) ;
163+ expect ( result . failed ) . toEqual ( 0 ) ;
164+ expect ( result . matches ) . toEqual ( 3 ) ;
165+ expect ( result . successful ) . toEqual ( 3 ) ;
166+ expect ( result . objects . map ( ( obj ) => obj . id ) . sort ( ) ) . toEqual (
167+ [ deleteManyFirstID , deleteManySecondID , deleteManyThirdID ] . sort ( )
168+ ) ;
169+ } ) ;
170+
152171 it ( 'should be able to delete many objects with a filter' , async ( ) => {
153172 const result = await collection . data . deleteMany (
154173 collection . filter . byProperty ( 'testProp' ) . equal ( 'DELETE ME' )
0 commit comments