From 86dad8525c62ec2c54b07f11775d7e38665918bd Mon Sep 17 00:00:00 2001 From: Ivo Fritsch Date: Tue, 1 Sep 2020 18:53:02 +0000 Subject: [PATCH] Removes the preserveUniqueKey flag from index specification after using it --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index 90e43f3..b89f046 100644 --- a/index.js +++ b/index.js @@ -170,6 +170,8 @@ class MongoTenant { index[0] = tenantAwareIndex; } + // Removes the possible preserveUniqueKey flag, that generates an validation error on MongoDB + delete index[1].preserveUniqueKey }); // apply tenancy awareness to field level unique indexes