How to declare collection name and model name in mongoose
<p>I have 3 kind of records,</p>

<pre><code>1)Categories,
2)Topics  and
3)Articles 
</code></pre>

<p>In my mongodb, i have only 1 colection named 'categories' in which i stroe the above 3 types of documents.</p>

<p>For these 3 modules,i wrote 3 models(one each) in such a way like below,</p>

<pre><code>mongoose.model('categories', CategorySchema);
mongoose.model('categories', TopicSchema)
mongoose.model('categories', ArticlesSchema)
</code></pre>

<p>like....mongoose.model('collection_name', Schema_name)</p>

<p>but when i run my code ,it throws error that </p>

<pre><code>Cannot overwrite `categories` model once compiled.
</code></pre>

<p>If i change the above models like this,</p>

<pre><code>mongoose.model('category','categories', CategorySchema);
mongoose.model('topics','categories', TopicSchema)
mongoose.model('articles','categories', ArticlesSchema)
</code></pre>

<p>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....</p>