Skip to content

Commit f29a37f

Browse files
committed
fix(docs): update README
1 parent 9d28e14 commit f29a37f

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ yarn add mongoose-history-diff
2121
npm i mongoose-history-diff
2222
```
2323

24-
## Usage
24+
## Usage
2525

26-
27-
### Add plugin to your schema:
26+
### Add plugin to your schema:
2827
```js
2928
import DiffPlugin from 'mongoose-history-diff';
3029
```
@@ -38,9 +37,9 @@ import DiffPlugin from 'mongoose-history-diff';
3837

3938
`diffCollectionName` option define the name of collection with diffs. If not provided `${parent_collection_name}_diffs` will be used.
4039

41-
### Exclude fields
40+
### Exclude fields
4241

43-
You can exlude document fields from tracking by adding `{ track_diff: false }` property to your field definition inside the schema:
42+
You can exclude document fields from tracking by adding `{ track_diff: false }` property to your field definition inside the schema:
4443

4544
```js
4645
export const PostSchema: MongooseSchema<PostDoc> = new mongoose.Schema(
@@ -70,7 +69,7 @@ import DiffPlugin from 'mongoose-history-diff';
7069

7170
## Track diffs
7271

73-
After adding, plugin will create a diff document with a following shape in separate collection on every changing of your documents.
72+
After adding, the plugin will create a diff document with the following shape in a separate collection on every changing of your documents.
7473

7574
```js
7675
{
@@ -107,12 +106,12 @@ Diffs are represented as one or more change records. Change records have the fol
107106
* `i` - when `k === 'A'`, indicates the array index where the change occurred
108107
* `it` - when `k === 'A'`, contains a nested change record indicating the change that occurred at the array index
109108

110-
Under the hood plugin uses refactored and simplified algorithm of `deep-diff` package, that is why this plugin has similar structure of changes. You can explore that [repo](https://github.com/flitbit/diff) too if you are interested in.
109+
Under the hood, the plugin uses refactored and simplified algorithm of `deep-diff` package, that is why this plugin has similar structure of changes. You can explore that [repo](https://github.com/flitbit/diff) too if you are interested in.
111110

112111

113112
## Methods
114113

115-
Also, plugin will add static `diffModel` method that return the model of diff collection.
114+
Also, the plugin will add a static `diffModel` method that returns the model of diff collection.
116115

117116
```js
118117
const Diff = Post.diffModel();
@@ -127,7 +126,7 @@ This model contains several static methods as well:
127126

128127
## Contribution
129128

130-
Feel free to submit pull request. Also, be sure all tests has passed otherwise pull request won't be merged.
129+
Feel free to submit a pull request. Also, be sure all tests have passed otherwise pull request won't be merged.
131130

132131
## License
133132

0 commit comments

Comments
 (0)