month wise collection in mongodb using mongoose?

by user944513   Last Updated September 12, 2019 02:26 AM

I am trying to make a simple demo using mongodb mongoose.but my issue is I want to create month wise collection example SEP_2019 ,OCT_2019,DEC_2019.but each collection schema is same

var personSchema = new Schema({
 name: String
});

I have only one attribute/field name in my schema.

so my collection have this type of data

`SEP_2019`
[{
name:'test'
}]

so I want to create collection dynamically on the base of the month insert my data in that collection also retrieve that data from collection.also query that on collection ?

will I use mongoos or mongo client?



Related Questions


Using Model.create() and save() inside for loop

Updated November 14, 2017 23:26 PM