From 87a6e3e98d12ea09ff6c2fd63ddea65f897d0032 Mon Sep 17 00:00:00 2001 From: Miran Setinc Date: Mon, 2 Nov 2020 10:36:48 +0100 Subject: [PATCH] schema configurable options documentation added to README.md --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bdb727c..c17dcf6 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,10 @@ fastify.register( validateExistance: true, }, }, + // We can also add schema configurable options + options: { + timestamps: true, + }, }, { name: "accounts", @@ -113,12 +117,16 @@ Any models declared should follow the following format: { name: "profiles", // Required, should match name of model in database alias: "Profile", // Optional, an alias to inject the model as - schema: schemaDefinition // Required, should match schema of model in database, + schema: schemaDefinition, // Required, should match schema of model in database, + options: schemaOptions, // Optional, schema configurable options class: classDefinition // Optional, should be an ES6 class wrapper for the model } ``` The `schemaDefinition` variable should be created according to the [Mongoose Model Specification](https://mongoosejs.com/docs/schematypes.html). + +The `schemaOptions` variable should be created according to the [Mongoose Model Options Specification](https://mongoosejs.com/docs/guide.html#options). + The `classDefinition` variable should be created according to the [Mongoose Class Specification](https://mongoosejs.com/docs/4.x/docs/advanced_schemas.html). ## Author