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

Text change to better describe the behavior #700

Open
wants to merge 1 commit into
base: gh-pages-v2.3
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Immutable fields

If you want some field to be immutable you should set the `immutable` flag in the definition of a field. It won't be possible to change field's value once it has been persisted in the database. Let's take a look at the example.
If you want some field to be immutable you should set the `immutable` flag in the definition of a field. It won't be possible to change the field's value once the document has been persisted in the database. Let's take a look at the example.

```js
import { Class } from 'meteor/jagi:astronomy';
Expand All @@ -17,9 +17,9 @@ const User = Class.create({
var user = new User();
// It's possible to set a value.
user.createdAt = new Date('2015-09-14');
// It's possible to change a value as long as it was not save into database.
// It's possible to change the value as long as the document isn't saved into the database.
user.createdAt = new Date('2015-09-15');
user.save();
// Now setting a value will be denied.
user.createdAt = new Date('2015-09-16');
```
```