I have 3 kind of records,
1)Categories,
2)Topics and
3)Articles
In my mongodb, i have only 1 colection named \'categories\' in which i stroe
As you stated, When you write this,
mongoose.model('categories', CategorySchema);
mongoose.model('categories', TopicSchema);
mongoose.model('categories', ArticlesSchema);
The output becomes inappropriate so do this instead,
mongoose.model('category', CategorySchema);
mongoose.model('topic', TopicSchema);
mongoose.model('article', ArticlesSchema);
Bonus tip. Mongoose makes your collection name plural by default so change a little code if you want your collection name as you wrote.
mongoose.model('category', CategorySchema,'category');
mongoose.model('topic', TopicSchema,'topic');
mongoose.model('article', ArticlesSchema,'article');