From e6d05e34217f4b360b5a1fb29189284bb686d794 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Wed, 5 Aug 2015 19:08:25 -0700 Subject: [PATCH] fix specify index using mongodb property --- common/models/challenge.json | 7 ++++++- common/models/nonprofit.json | 7 ++++++- common/models/story.json | 19 ++++++++++--------- common/models/user.json | 4 +++- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/common/models/challenge.json b/common/models/challenge.json index 3258d641ee..baa78a4e4c 100644 --- a/common/models/challenge.json +++ b/common/models/challenge.json @@ -6,7 +6,12 @@ "properties": { "name": { "type": "string", - "unique": true + "index": { + "mongodb": { + "unique": true, + "background": true + } + } }, "title": { "type": "string" diff --git a/common/models/nonprofit.json b/common/models/nonprofit.json index 738c43e9ad..5d8dddbc3d 100644 --- a/common/models/nonprofit.json +++ b/common/models/nonprofit.json @@ -6,7 +6,12 @@ "properties": { "name": { "type": "string", - "unique": true + "index": { + "mongodb": { + "unique": true, + "background": true + } + } }, "whatDoesNonprofitDo": { "type": "string" diff --git a/common/models/story.json b/common/models/story.json index 8aab09964b..6f252cefb3 100644 --- a/common/models/story.json +++ b/common/models/story.json @@ -6,28 +6,29 @@ "properties": { "name": { "type": "string", - "unique": true + "index": { + "mongodb": { + "unique": true, + "background": true + } + } }, "headline": { - "type": "string", - "unique": false + "type": "string" }, "timePosted": { "type": "number", "default": 0 }, "link": { - "type": "string", - "unique": false + "type": "string" }, "metaDescription": { "type": "string", - "default": "", - "unique": false + "default": "" }, "description": { - "type": "string", - "unique": false + "type": "string" }, "originalStoryAuthorEmail": { "type": "string", diff --git a/common/models/user.json b/common/models/user.json index 97027fd50e..871cd2db46 100644 --- a/common/models/user.json +++ b/common/models/user.json @@ -10,6 +10,7 @@ "index": { "mongodb": { "unique": true, + "background": true, "sparse": true } } @@ -46,7 +47,8 @@ "require": true, "index": { "mongodb": { - "unique": true + "unique": true, + "background": true } } },