Skip to content

Commit

Permalink
Modify exemple and schema syntax
Browse files Browse the repository at this point in the history
- it seems `{ name: "string", size: "string" }` is a valid syntax, but I had to run some code to confirm it is :)
- in my opinion `{ name: String, size: String }` would be more coherent with the rest of the doc (especially for new learners who might find this snippet confusing)
  • Loading branch information
c-marc authored Apr 9, 2023
1 parent d4e513d commit 59e55bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ When you call `mongoose.model()` on a schema, Mongoose _compiles_ a model
for you.

```javascript
const schema = new mongoose.Schema({ name: 'string', size: 'string' });
const schema = new mongoose.Schema({ name: String, size: String });
const Tank = mongoose.model('Tank', schema);
```

Expand Down

0 comments on commit 59e55bb

Please sign in to comment.