Foker
Foker

Reputation: 1011

Autoincrement id field in MongoDB and nodejs(express framework)

How can i set an "id"-field in MongoDB-database with autoIncrement. I need unique numeric id. I know, that there's simple method instead of counting items... my application made with nodejs and expressjs framework

Upvotes: 1

Views: 4962

Answers (1)

Jayram
Jayram

Reputation: 19588

I have used mongoose auto increment plugin of mongoose for doing the same. It is quite helpful. You should have a look and give it a try.

Upvotes: 1

Related Questions