Skip to content

Commit

Permalink
docs: update usage docs
Browse files Browse the repository at this point in the history
This closes #42
  • Loading branch information
lykmapipo committed Sep 18, 2019
1 parent d3fa617 commit 548ef61
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ mongoose-gridfs
mongoose [gridfs](https://docs.mongodb.com/manual/core/gridfs/) on top of [new gridfs api](http://mongodb.github.io/node-mongodb-native/3.1/tutorials/gridfs/)

*Note!: Only compatible with Mongoose >= 5.7.0*

*Note!: Ensure mongoose connection before use*

## Installation
Expand Down Expand Up @@ -35,13 +36,13 @@ Attachment.write(options, readStream, (error, file) => {
});

// read larger file
const readStream = Attachment.readById(objectid);
const readStream = Attachment.read({ _id });

// read smaller file
Attachment.readById(objectid, (error, buffer) => { ... });
Attachment.read({ _id }, (error, buffer) => { ... });

// remove file and its content
Attachment.unlink(objectid, (error) => { ... });
Attachment.unlink({ _id }, (error) => { ... });
```


Expand Down

0 comments on commit 548ef61

Please sign in to comment.