@casl/mongoose@5.0.0
5.0.0 (2021-05-10)
Code Refactoring
BREAKING CHANGES
-
mongoose: migrates
@casl/mongooseto official mongoose types. This is a breaking change for TypeScript users. What you need to do is tonpm uninstall @types/mongoose
and extend model interfaces by
mongoose.DocumentBefore
interface Post { title: string; content: string; } const schema = new mongoose.Schema<Post>({ // model definition });
After
import mongoose from "mongoose"; interface Post extends mongoose.Document { title: string; content: string; } const schema = new mongoose.Schema<Post>({ // model definition });
For example, check updated README.md