mongodb-autoincrement

JSON →
library 1.0.1 ·javascript maintenance
verified Jun 5, 2026

Provides auto-incrementing integer IDs for MongoDB documents, compatible with both the native MongoDB driver and Mongoose. Version 1.0.1 (last updated 2015) is a stable, minimal plugin that relies on a separate 'counters' collection to track sequence values. It supports custom field names, steps, and global Mongoose schema plugin. Unlike MongoDB's built-in ObjectId, this plugin uses sequential integers; it does not support atomic increment guarantees across sharded clusters and cannot set initial values programmatically.