##############################################################################*/\r
\r
\r
-const mongooseGridFS = require('mongoose-gridfs');\r
-\r
module.exports = function (app) {\r
- const mongoose = app.get('mongooseClient');\r
-\r
- const gridfs = mongooseGridFS({\r
- collection: 'fs',\r
- model: 'File',\r
- mongooseConnection: mongoose.connection\r
- });\r
+ const mongooseClient = app.get('mongooseClient');\r
+ const { Schema } = mongooseClient;\r
+ const files = new Schema({//Esquema base de los usuarios.\r
+ length: {\r
+ type: Number\r
+ },\r
+ chunkSize: {\r
+ type: Number\r
+ },\r
+ uploadDate: {\r
+ type: Date\r
+ },\r
+ md5: {\r
+ type: String\r
+ },\r
+ filename: {\r
+ type: String\r
+ },\r
+ contentType: {\r
+ type: String\r
+ },\r
+ metadata: {\r
+ type: Object\r
+ },\r
+ path:{\r
+ type:String,\r
+ readonly:true\r
+ }\r
+ },{collection:`fs.files`, shardKey: { filename: 1 }});\r
+ \r
+ return mongooseClient.model('files', files);\r
\r
- return gridfs.model;\r
};\r