Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.x migration guide: fix setter change example code #7546

Merged
merged 2 commits into from
Feb 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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