How can The Model class be a subclass of the Document class?

158 Views Asked by At

Mongoose docs

The underline statement does not make any sense to me. I believe mongoose devs didn't publish their docs wrong and I'm missing a point.

console.log(mongoose.Model instanceof mongoose.Document)

Also when I run the code above, it outputs false.

Can someone explain what docs really want to imply?

1

There are 1 best solutions below

0
Özgür On

I found an answer. It is not so satisfying but for those of people who are also curios about the question can check this link.

Briefly, even if we cannot see the behavior explicitly, it is in the source code.