Mongoose - Force Collection Name

test

const dataSchema = new Schema({..}, { collection: 'data' });

or

const Document = mongoose.model("Document", documentSchema, "<collection>");

Refs:
https://mongoosejs.com/docs/guide.html#collection

https://stackoverflow.com/questions/7486528/mongoose-force-collection-name

More from Teo Oliver
All posts