From af8b59115759936431708fcbd90ab2d6d96d9d41 Mon Sep 17 00:00:00 2001 From: Henrik Karlsson Date: Tue, 31 Jan 2017 13:49:34 +0100 Subject: [PATCH] Remove required: true for autoincremented field --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 9496ebc..3e9c4dd 100644 --- a/index.js +++ b/index.js @@ -55,7 +55,7 @@ exports.mongoosePlugin = function (schema, options) { if (schema.options._id) { var schemaField = {}; - schemaField[fieldName] = {type: Number, unique: true, required: true}; + schemaField[fieldName] = {type: Number, unique: true}; schema.add(schemaField); }