Skip to content

Node.js based forum software built for the modern web

convert key, value index to sparse/unique

barisusakli484ad33549ce
diff --git a/src/database/mongo.js b/src/database/mongo.js
index 63fdc8b9c2..cc9bacec1c 100644
--- a/src/database/mongo.js
+++ b/src/database/mongo.js
@@ -133,7 +133,7 @@
function createIndices() {
async.parallel([
async.apply(createIndex, 'objects', {_key: 1, score: -1}, {background: true}),
- async.apply(createIndex, 'objects', {_key: 1, value: -1}, {background: true}),
+ async.apply(createIndex, 'objects', {_key: 1, value: -1}, {background: true, unique: true, sparse: true}),
async.apply(createIndex, 'objects', {expireAt: 1}, {expireAfterSeconds: 0, background: true}),