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"}) employee.save 

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

Replay

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

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

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