robin*

db 인덱스 추가

...@@ -2,3 +2,8 @@ const config = require('./config'); ...@@ -2,3 +2,8 @@ const config = require('./config');
2 const db = require('monk')(config.db); 2 const db = require('monk')(config.db);
3 3
4 module.exports = db; 4 module.exports = db;
5 +
6 +db.then(async() => {
7 + await db.get('board').createIndex({name: 1}, {unique: true});
8 + await db.get('thread').createIndex({board: 1, lastUpdated: -1});
9 +});
......