Skip to content

Commit

Permalink
docs(migrating_to_6): fix strictQuery example
Browse files Browse the repository at this point in the history
Fix #10602
  • Loading branch information
vkarpov15 committed Aug 25, 2021
1 parent 508d1d8 commit 1310e76
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/migrating_to_6.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ const User = mongoose.model('User', userSchema);
await User.find({ notInSchema: 1 });

// Set `strict: false` to opt in to filtering by properties that aren't in the schema
await User.find({ notInSchema: 1 }, { strict: false });
await User.find({ notInSchema: 1 }, null, { strict: false });
// equivalent:
await User.find({ notInSchema: 1 }).setOptions({ strict: false });
```

<h3 id="mongoerror-is-now-mongoservererror"><a href="#mongoerror-is-now-mongoservererror">MongoError is now MongoServerError</a></h3>
Expand Down

0 comments on commit 1310e76

Please sign in to comment.