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 the above 3 types of documents.
For these 3 modules,i wrote 3 models(one each) in such a way like below,
mongoose.model('categories', CategorySchema);
mongoose.model('categories', TopicSchema)
mongoose.model('categories', ArticlesSchema)
like....mongoose.model('collection_name', Schema_name)
but when i run my code ,it throws error that
Cannot overwrite `categories` model once compiled.
If i change the above models like this,
mongoose.model('category','categories', CategorySchema);
mongoose.model('topics','categories', TopicSchema)
mongoose.model('articles','categories', ArticlesSchema)
It is creating 2 collections named topics and articles which i dont want. This is my issue right now,can anyone suggest me help.....Thanks....