Passing validateBeforeSave:false
via params.mongoose
does not work.
#257
Labels
validateBeforeSave:false
via params.mongoose
does not work.
#257
Steps to reproduce
There is a Users Schema in my project with a
password
field which is set to 'required: true'.Now I have to create a list of users using data from an excel file which does not offer any
password
value (because the boss hopes no password can be touched by client users).So I have to skip the mongoose validation when I call feathers service to create a user.
I found in docs here that
params.mongoose
will help (see https://github.com/feathersjs-ecosystem/feathers-mongoose#paramsmongoose).I use the code:
but it still validates the doc and throw an error
Path password is required
.Expected behavior
Passing
validateBeforeSave:false
viaparams.mongoose
should skip mongoose validating before creating.Actual behavior
Passing
validateBeforeSave:false
viaparams.mongoose
does not work.System configuration
Version
node.js: 8.9.3
mongoose: 5.2.3
MongoDB: 3.6.1
feathers-mongoose: 6.1.2
The text was updated successfully, but these errors were encountered: