From 59e55bbf23c5116cb85ceb5f2e3e0f689b338b1f Mon Sep 17 00:00:00 2001 From: c-marc <33377104+c-marc@users.noreply.github.com> Date: Sun, 9 Apr 2023 20:50:24 +0200 Subject: [PATCH] Modify exemple and schema syntax - 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) --- docs/models.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/models.md b/docs/models.md index 30f179744f5..200556b96c2 100644 --- a/docs/models.md +++ b/docs/models.md @@ -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); ```