Browse Source

chore: updates README.md

e22m4u 2 years ago
parent
commit
780527c025
1 changed files with 14 additions and 0 deletions
  1. 14 0
      README.md

+ 14 - 0
README.md

@@ -214,6 +214,20 @@ schema.defineModel({
 
 // получение репозитория модели "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
+// }
 ```
 
 #### Методы