From 9c1fd5b13a2016b47d2dc37ae45e403a41465107 Mon Sep 17 00:00:00 2001 From: Scott Tolksdorf Date: Sat, 14 May 2016 13:15:46 -0400 Subject: [PATCH] Adding both the share and edit ids as unique indexes, should speed up DB query time --- server/homebrew.model.js | 4 ++-- todo.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/homebrew.model.js b/server/homebrew.model.js index 9cc4ef9..d20b758 100644 --- a/server/homebrew.model.js +++ b/server/homebrew.model.js @@ -3,8 +3,8 @@ var shortid = require('shortid'); var _ = require('lodash'); var HomebrewSchema = mongoose.Schema({ - shareId : {type : String, default: shortid.generate}, - editId : {type : String, default: shortid.generate}, + shareId : {type : String, default: shortid.generate, index: { unique: true }}, + editId : {type : String, default: shortid.generate, index: { unique: true }}, title : {type : String, default : ""}, text : {type : String, default : ""}, diff --git a/todo.md b/todo.md index 286f840..ea5ab2f 100644 --- a/todo.md +++ b/todo.md @@ -20,7 +20,7 @@ X Rename `/client/naturalCrit` -> `/client/main` X Move snippets into their new groups - Replace pseudo-elements with encoded images - Make hybrid editor and brewRenderer (with resize listeners) -- add /source/shareId route +X add /source/shareId route - Add stats nav item - make both ids indexes in mongoose X Fix main Page