comparatorFn is not a function - updateMany doesn't support 'where', expects 'which' v0.5.0
VickyKoblinski opened this issue · comments
Hey, I see that recently which
was replaced with where
. I have the latest version of this mswjs/data (v0.5.0) from npm and when I try using where
in updateMany
I get:
TypeError: comparatorFn is not a function
Changing where
to which
has resolved my problem for now :)
Hey, @VickyKoblinski.
Could you please share your updateMany
call? The error you're describing hints that there's an invalid comparator being used (equals/gte/lt/etc.). If you share your usage I can try to help you solve the problem.
I confirm that version 0.5.0
expects and properly handles the where
property in all model operations.
Here's an integration test for the updateMany
method that uses where
and successfully passes:
data/test/model/updateMany.test.ts
Lines 27 to 41 in 808295f
Please ensure you're using the latest @mswjs/data
version. You can do so by:
$ npm ls @mswjs/data
Or just update to the latest published version by:
$ npm install @mswjs/data@latest -D
# or
$ yarn add @mswjs/data@latest