Corrected gridfs api

parent 434ef08b
......@@ -5,6 +5,7 @@
"use strict";
const mongoose = require('mongoose');
const gridfs = require('mongoose-gridfs');
const logger = require('./logger')('error');
mongoose.Promise = global.Promise;
......@@ -30,7 +31,7 @@ module.exports = (connectionUri, relaxed) => {
mongoose.connection = connection;
module.exports.connection = connection;
let files_fs = require('mongoose-gridfs')({
let files_fs = gridfs.createModel({
collection: 'files',
model: 'files',
mongooseConnection: connection
......@@ -38,7 +39,7 @@ module.exports = (connectionUri, relaxed) => {
mongoose.files = files_fs.model;
let testing_fs = require('mongoose-gridfs')({
let testing_fs = gridfs.createModel({
collection: 'testing',
model: 'testing',
mongooseConnection: connection
......@@ -46,7 +47,7 @@ module.exports = (connectionUri, relaxed) => {
mongoose.testingFiles = testing_fs.model;
let solution_fs = require('mongoose-gridfs')({
let solution_fs = gridfs.createModel({
collection: 'solution',
model: 'solution',
mongooseConnection: connection
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment