From 154050010106d0e2cbabbfe009f3693f6d3fc73a Mon Sep 17 00:00:00 2001 From: Sven Varkel Date: Mon, 4 Nov 2019 22:04:43 +0200 Subject: [PATCH] added bucketOptions I added bucketOptions. Specifying GridFS bucket name with dot at the end of the URI would give an error. It takes bucketOptions: {} as per specification found in skipper-gridfs repository and GridFS documentation at http://mongodb.github.io/node-mongodb-native/3.1/api/GridFSBucket.html. --- concepts/File Uploads/uploading-to-mongo-gridfs.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/concepts/File Uploads/uploading-to-mongo-gridfs.md b/concepts/File Uploads/uploading-to-mongo-gridfs.md index e102c03aa..0bf8dfd4e 100644 --- a/concepts/File Uploads/uploading-to-mongo-gridfs.md +++ b/concepts/File Uploads/uploading-to-mongo-gridfs.md @@ -14,7 +14,11 @@ Then use it in one of your controllers: uploadFile: function (req, res) { req.file('avatar').upload({ adapter: require('skipper-gridfs'), - uri: 'mongodb://[username:password@]host1[:port1][/[database[.bucket]]' + uri: 'mongodb://[username:password@]host1[:port1][/[database]', + bucketOptions: { + bucketName: '', + //other bucket parameters as seen at http://mongodb.github.io/node-mongodb-native/3.1/api/GridFSBucket.html + } }, function (err, filesUploaded) { if (err) return res.serverError(err); return res.ok();