knox 已修改 . 還原成這個修訂版本
1 file changed, 16 insertions
TypeORM-readme-4.ts(檔案已創建)
@@ -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() |
上一頁
下一頁