I'm trying to create a capped collection using Mongoose, however the following creates a collection that is not capped:
var schema = new mongoose.Schema(
{
Name: { type: String },
Text: { type: String }
},
{
capped: { max: 5, size: 1000000 }
});
I'm pretty sure I'm following the documentation's example properly, but clearly I'm doing something wrong.
new Schema({..}, { capped: { size: 1024, max: 1000, autoIndexId: true } });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With