Adding data to the field having ID in mongoose

I have a collection employees in that I want to put id field along with default _id field. But I can't able to create the record. I tried below way

employee = new Employee({id: "1234", name: "emp name"}) 

First time it is creating record only with name. Can anyone help me out of this. I put unique index for id field.


Category: node.js Time: 2016-07-31 Views: 3

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.231 (s). 12 q(s)