knox revisó este gist . Ir a la revisión
1 file changed, 16 insertions
TypeORM-readme-4.ts(archivo creado)
@@ -0,0 +1,16 @@ | |||
1 | + | const user = new User() | |
2 | + | user.firstName = "Timber" | |
3 | + | user.lastName = "Saw" | |
4 | + | user.age = 25 | |
5 | + | await user.save() | |
6 | + | ||
7 | + | const allUsers = await User.find() | |
8 | + | const firstUser = await User.findOneBy({ | |
9 | + | id: 1, | |
10 | + | }) | |
11 | + | const timber = await User.findOneBy({ | |
12 | + | firstName: "Timber", | |
13 | + | lastName: "Saw" | |
14 | + | }) | |
15 | + | ||
16 | + | await timber.remove() |
Siguiente
Anterior