Browse Source

chore: updates README.md

e22m4u 2 years ago
parent
commit
a70af5ed7c
1 changed files with 11 additions and 4 deletions
  1. 11 4
      README.md

+ 11 - 4
README.md

@@ -217,14 +217,21 @@ schema.defineModel({
 schema.defineModel({
   name: 'place',
   properties: {
-    name: {
-      type: DataType.STRING,
-      required: true,
-    },
+    // базовое определение поля "name"
+    // с передачей типа "string"
+    name: DataType.STRING,
+    // расширенное определение поля "location"
+    // с передачей модели допустимого значения
+    // и флага "required" исключающего null
+    // и undefined
     location: {
       type: DataType.OBJECT,
       model: 'latLng',
+      required: true,
     },
+    // расширенное определение поля "keywords"
+    // с передачей типа допустимого элемента
+    // и фабрикой значения по умолчанию
     keywords: {
       type: DataType.ARRAY,
       itemType: DataType.STRING,