model.createCollection
fails for capped collection when using capped: number
#11539
Labels
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
Milestone
Do you want to request a feature or report a bug?
Report a bug
What is the current behavior?
Calling
model.createCollection
for a model that specifiescapped: number
throws an error:MongoServerError: the 'size' field is required when 'capped' is true
. Specifyingcapped: { size: number }
instead throws no error.If the current behavior is a bug, please provide the steps to reproduce.
It seems like the logic at
mongoose/lib/model.js
Line 1370 in c5893fa
capped: number
scenario.What is the expected behavior?
No error is thrown
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
node
: 16.14.0mongoose
: 6.2.4mongodb
: 4.4The text was updated successfully, but these errors were encountered: