Skip to content

Commit

Permalink
Merge pull request #7546 from hellodigit/migration-5-setters
Browse files Browse the repository at this point in the history
5.x migration guide: fix setter change example code
  • Loading branch information
vkarpov15 committed Feb 21, 2019
2 parents e0b4b2f + 0ad1f1f commit b6327e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/guide.jade
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ block content
.important
:markdown
If you haven't yet done so, please take a minute to read the [quickstart](./index.html) to get an idea of how Mongoose works.
If you are migrating from 4.x to 5.x please take a moment to read the [migration guide](https://github.com/Automattic/mongoose/blob/master/migrating_to_5.md).
If you are migrating from 4.x to 5.x please take a moment to read the [migration guide](/docs/migrating_to_5.html).
:markdown
<ul class="toc">
<li><a href="#models">Defining your schema</a></li>
Expand Down
8 changes: 4 additions & 4 deletions docs/migrating_to_5.jade
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,17 @@ block content
```javascript
const schema = new Schema({ name: String });
schema.path('name').
get(() => console.log('This will print 2nd')).
get(() => console.log('This will print first'));
set(() => console.log('This will print 2nd')).
set(() => console.log('This will print first'));
```

In 5.x, setters run in the order they're declared.

```javascript
const schema = new Schema({ name: String });
schema.path('name').
get(() => console.log('This will print first')).
get(() => console.log('This will print 2nd'));
set(() => console.log('This will print first')).
set(() => console.log('This will print 2nd'));
```

<h3 id="id-getter"><a href="#id-getter">
Expand Down

0 comments on commit b6327e9

Please sign in to comment.