From 458b0d1256c24da54f44f1814d3bf54d07576916 Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Tue, 5 Sep 2017 15:33:32 +0100 Subject: [PATCH 1/2] Update to node6. - update nvmrc file - update mongojs dependency (for migrations) --- server-ce/.nvmrc | 2 +- server-ce/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server-ce/.nvmrc b/server-ce/.nvmrc index 61012ac6c8..e18a34b9d6 100644 --- a/server-ce/.nvmrc +++ b/server-ce/.nvmrc @@ -1 +1 @@ -0.10.26 +6.11.2 diff --git a/server-ce/package.json b/server-ce/package.json index 3d63f4c5fa..5825b147f8 100644 --- a/server-ce/package.json +++ b/server-ce/package.json @@ -10,7 +10,7 @@ "grunt-shell": "^1.1.1", "load-grunt-config": "^0.19.2", "lodash": "^3.0.0", - "mongojs": "^0.18.1", + "mongojs": "2.4.0", "redis": "^2.6.2", "rimraf": "~2.2.6", "settings-sharelatex": "git+https://github.com/sharelatex/settings-sharelatex.git", From 93b8a9b13d502eae99573ffeccfd06a8e6b8314c Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Wed, 6 Sep 2017 09:56:44 +0100 Subject: [PATCH 2/2] Fix the doc lines migration. - The bson module changed at some point, update to new api --- .../migrations/1_move_doc_lines_to_doc_collection.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server-ce/migrations/1_move_doc_lines_to_doc_collection.coffee b/server-ce/migrations/1_move_doc_lines_to_doc_collection.coffee index 8712cf9f54..e4433de7bd 100644 --- a/server-ce/migrations/1_move_doc_lines_to_doc_collection.coffee +++ b/server-ce/migrations/1_move_doc_lines_to_doc_collection.coffee @@ -1,4 +1,6 @@ Settings = require "settings-sharelatex" +bson = require('bson') +BSON = new bson() fs = require("fs") mongojs = require("mongojs") ObjectId = mongojs.ObjectId @@ -61,7 +63,7 @@ getAllDocs = (project_id, callback = (error, docs) ->) -> if !project? console.log "no such project #{project_id}" return callback() - size = require("../node_modules/mongojs/node_modules/mongodb/node_modules/bson/").BSONPure.BSON.calculateObjectSize(project) + size = BSON.calculateObjectSize(project) if size > 12000000 #12mb return markProjectAsToLargeAndFinished project_id, callback findAllDocsInProject project, (error, docs) ->