From 23fdfcc23dde16d3b49f0c990e3a14360155a44e Mon Sep 17 00:00:00 2001 From: knacharam-rythmos Date: Tue, 23 Oct 2018 11:07:34 +0530 Subject: [PATCH] fix for https://github.com/matteodelabre/mongoose-beautiful-unique-validation/issues/57 --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 029571e..349b516 100644 --- a/index.js +++ b/index.js @@ -68,7 +68,7 @@ function collectMessages(tree) { tree[key].unique = true; } else { // Nested schema - var subtree = collectMessages(tree[key]); + var subtree = collectMessages(tree[key].tree); for (var subkey in subtree) { if (subtree.hasOwnProperty(subkey)) {