e22m4u 2 лет назад
Родитель
Сommit
780527c025
1 измененных файлов с 14 добавлено и 0 удалено
  1. 14 0
      README.md

+ 14 - 0
README.md

@@ -214,6 +214,20 @@ schema.defineModel({
 
 
 // получение репозитория модели "city"
 // получение репозитория модели "city"
 const cityRep = schema.getRepository('city');
 const cityRep = schema.getRepository('city');
+
+// записываем новый документ "city"
+const city = await cityRep.create({
+  name: 'Moscow',
+  population: 11980000
+});
+
+// выводим результат
+console.log(city);
+// {
+//   "id": 1,
+//   "name": "Moscow",
+//   "population": 11980000
+// }
 ```
 ```
 
 
 #### Методы
 #### Методы