From dab9231fd8f3fa10b4c3f4991fc98aa03d3b19f0 Mon Sep 17 00:00:00 2001
From: syuilo <syuilotan@yahoo.co.jp>
Date: Tue, 7 Nov 2017 19:33:54 +0900
Subject: [PATCH] Fix bug

---
 tools/migration/use-gridfs.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/migration/use-gridfs.js b/tools/migration/use-gridfs.js
index 4401e83016..804f2aa27e 100644
--- a/tools/migration/use-gridfs.js
+++ b/tools/migration/use-gridfs.js
@@ -49,7 +49,7 @@ async function main() {
 
 	const iterate = async () => {
 		if (i == count) return true;
-		const doc = await db.get('drive_files').find({}, { limit: 1, skip: i })
+		const doc = (await db.get('drive_files').find({}, { limit: 1, skip: i }))[0]
 		const res = await migrateToGridFS(doc);
 		if (!res) {
 			return false;