File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -221,10 +221,10 @@ export class User extends Model<User> {}
221
221
### Build and create
222
222
Instantiation and inserts can be achieved in the good old sequelize way
223
223
``` typescript
224
- const person = Person .build < Person > ({name: ' bob' , age: 99 });
224
+ const person = Person .build ({name: ' bob' , age: 99 });
225
225
person .save ();
226
226
227
- Person .create < Person > ({name: ' bob' , age: 99 });
227
+ Person .create ({name: ' bob' , age: 99 });
228
228
```
229
229
but * sequelize-typescript* also makes it possible to create instances with ` new ` :
230
230
``` typescript
@@ -237,15 +237,15 @@ Finding and updating entries does also work like using native sequelize. So see
237
237
[ docs] ( http://docs.sequelizejs.com/manual/tutorial/models-usage.html ) for more details.
238
238
``` typescript
239
239
Person
240
- .findOne < Person > ()
240
+ .findOne ()
241
241
.then (person => {
242
242
243
243
person .age = 100 ;
244
244
return person .save ();
245
245
});
246
246
247
247
Person
248
- .update < Person > ({
248
+ .update ({
249
249
name: ' bobby'
250
250
}, {where: {id: 1 }})
251
251
.then (() => {
@@ -290,7 +290,7 @@ That's all, *sequelize-typescript* does everything else for you. So when retriev
290
290
``` typescript
291
291
292
292
Team
293
- .findOne < Team > ({include: [Player ]})
293
+ .findOne ({include: [Player ]})
294
294
.then (team => {
295
295
296
296
team .players .forEach (player => console .log (` Player ${player .name } ` ));
You can’t perform that action at this time.
0 commit comments