From 1c3d9f7e94112ed9995089a5e717748658a2c558 Mon Sep 17 00:00:00 2001
From: barisusakli <barisusakli@gmail.com>
Date: Thu, 24 Nov 2016 16:15:04 +0300
Subject: [PATCH] switch to createIndex

---
 src/database/mongo.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/database/mongo.js b/src/database/mongo.js
index 2733e0ef31..1528671770 100644
--- a/src/database/mongo.js
+++ b/src/database/mongo.js
@@ -141,7 +141,7 @@
 
 			function createIndices() {
 				winston.info('[database] Checking database indices.');
-				async.parallel([
+				async.series([
 					async.apply(createIndex, 'objects', {_key: 1, score: -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})
@@ -155,7 +155,7 @@
 			}
 
 			function createIndex(collection, index, options, callback) {
-				db.collection(collection).ensureIndex(index, options, callback);
+				db.collection(collection).createIndex(index, options, callback);
 			}
 		});
 	};