From bcb686ced923659e158bd964c8b4daf0f0f40222 Mon Sep 17 00:00:00 2001 From: GuroKung Date: Fri, 6 Oct 2017 11:57:32 +0700 Subject: [PATCH 1/2] Update README.md - working with collection --- Readme.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Readme.md b/Readme.md index 2bdf141..cca5411 100644 --- a/Readme.md +++ b/Readme.md @@ -195,6 +195,15 @@ Alternatively you can use the ```gfs.findOne```-shorthand to find a single file console.log(file); }); ``` +## working with collection + +If no collection name is specified, the default root mongodb gridfs collection `fs` will be used. + +Use method `collection()` to change the default collection to `custom-collection-name` + +``` +gfs.collection('custom-collection-name'); +``` ## using with mongoose From 4085891edb70fa89cfd348efb4d0fa5bb7ce2f2c Mon Sep 17 00:00:00 2001 From: Jiratchaya Intaragumhaeng Date: Mon, 9 Oct 2017 00:25:29 +0700 Subject: [PATCH 2/2] Update Readme.md js code block --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index cca5411..f4fee57 100644 --- a/Readme.md +++ b/Readme.md @@ -201,7 +201,7 @@ If no collection name is specified, the default root mongodb gridfs collection ` Use method `collection()` to change the default collection to `custom-collection-name` -``` +```js gfs.collection('custom-collection-name'); ```