From 35ff243fca9a881eb336d1fed715578166a9c36c Mon Sep 17 00:00:00 2001 From: Agnes Lin Date: Thu, 16 Jan 2020 15:20:08 -0500 Subject: [PATCH] docs: specify strict:false is only supported by NoSQL DBs --- docs/site/Model.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/site/Model.md b/docs/site/Model.md index e3ef1722e4e0..6eb0c1356420 100644 --- a/docs/site/Model.md +++ b/docs/site/Model.md @@ -136,16 +136,18 @@ forbid additional properties that are not specified in the type definition. The persistence layer respects this constraint and configures underlying PersistedModel classes to enforce `strict` mode. -To create a model that allows both well-defined but also arbitrary extra -properties, you need to disable `strict` mode in model settings through the CLI -and tell TypeScript to allow arbitrary additional properties to be set on model -instances. +LB4 supports creating a model that allows both well-defined but also arbitrary +extra properties for **NoSQL** databases such as MongoDB. You need to disable +`strict` mode in model settings. Besides modifying model settings directly, it +can also be done through the CLI by setting `allowed free-from properties` to +true by saying yes when given this prompt and telling TypeScript to allow +arbitrary additional properties to be set on model instances. ```ts @model({settings: {strict: false}}) class MyFlexibleModel extends Entity { @property({id: true}) - id: number; + id: string; // Define well-known properties here @@ -255,10 +257,10 @@ now: Specifies whether the model accepts only predefined properties or not. One of: