const db = mongoose.model('User', userSchema, 'user')
What is use of that third parameter? Where can we use that parameter. What is use of that parameter. Any practical example
const db = mongoose.model('User', userSchema, 'user')
What is use of that third parameter? Where can we use that parameter. What is use of that parameter. Any practical example
The third parameter is an explicit collection name.
Once I faced this use case , we had client and he want to have a prefix for each collection name when it get created in db ,something like "apple_users" , in that case it was useful