λ³Έλ¬Έ λ°”λ‘œκ°€κΈ°
πŸ“ŒCS/DB

[Sequelize v5] μ‹œν€„λΌμ΄μ¦ˆ find ν•¨μˆ˜ 였λ₯˜

by dar0m! 2019. 5. 29.

Sequelize

(1) 문제

TypeError: User.find is not a function

μœ„μ˜ 였λ₯˜κ°€ μ΄ν‹€λ™μ•ˆ λ‚˜λ₯Ό κ΄΄λ‘­ν˜”λ‹€.. μ½”λ“œλ₯Ό 샅샅이 뒀지며 μ˜€νƒ€κ°€ μžˆλŠ”μ§€ ν™•μΈν•˜κ³ , μ£Όμ„μœ„μΉ˜λ„ 바꿔보고 λ…Έμ˜€λ ₯을 ν•΄λ΄€μ§€λ§Œ 같은 였λ₯˜κ°€ λ°œμƒν–ˆκ³  이제 μ˜μ‹¬ν• κ²ƒμ€ find ν•¨μˆ˜μ— λŒ€ν•œ μ˜μ‹¬λ°–μ— 남지 μ•Šμ€ μƒνƒœμ˜€λ‹€.

 

(2) ν•΄κ²°

ν‚€μ›Œλ“œλŠ” 'μ‹œν€„λΌμ΄μ¦ˆ find ν•¨μˆ˜ μ‚¬μš©' 으둜 κ²€μƒ‰ν•΄μ„œ μ•„λž˜ λΈ”λ‘œκ·Έλ₯Ό λ§Œλ‚¬κ³  이전에 λ¬Έμ œκ°€ λ˜μ—ˆλ˜ 였λ₯˜λ“€μ˜ ν•΄κ²°λ°©μ•ˆλ„ μ‰½κ²Œ 찾을 수 μžˆμ—ˆλ‹€.

https://www.zerocho.com/category/etc/post/5b4c1d526a3abe001b94de0b

 

(etc) Node.js κ΅κ³Όμ„œ μ§ˆμ˜μ‘λ‹΅μš© 포슀트

FAQ 슀슀둜 해보기 ν’€μ΄λŠ” μ—†λ‚˜μš”? - μœ νŠœλΈŒλ‚˜ μΈν”„λŸ° κ°•μ’Œμ—μ„œ μ œκ³΅ν•©λ‹ˆλ‹€(μΈν”„λŸ°μ—μ„œλ„ 무료둜 보싀 수 μžˆμŠ΅λ‹ˆλ‹€.) https://open.kakao.com/me/zerocho 둜 μ—°λ½μ£Όμ‹œλ©΄ μΈν”„λŸ° 할인 쿠폰을 λ“œλ¦½λ‹ˆλ‹€.  μ˜€νƒ€&였λ₯˜ μ •μ˜€ν‘œλŠ” 어디에

www.zerocho.com

 

결둠은 μ‹œν€„λΌμ΄μ¦ˆ 버전 5κ°€ λ˜λ©΄μ„œ findν•¨μˆ˜κ°€ μ—†μ–΄μ‘Œκ³  κ·Έ λŒ€μ•ˆμœΌλ‘œ findOneμ΄λΌλŠ” ν•¨μˆ˜κ°€ μƒκ²Όλ‹€λŠ” 것이닀. find둜 μž‘μ„±ν–ˆλ˜ μ½”λ“œλ₯Ό findOne으둜 λ°”κΎΈλ©΄ ν•΄κ²°λœλ‹€.

 

μ‹œν€„λΌμ΄μ¦ˆ 버전5 이후 바뀐 ν•¨μˆ˜λ“€μ— λŒ€ν•œ λ‚΄μš©μ€ μ•„λž˜ κ³΅μ‹λ¬Έμ„œλ₯Ό ν™•μΈν•˜μ„Έμš”.

http://docs.sequelizejs.com/manual/upgrade-to-v5.html

 

Manual | Sequelize

Upgrade to v5 Sequelize v5 is the next major release after v4 Breaking Changes Support for Node 6 and up Sequelize v5 will only support Node 6 and up #9015 Secure Operators With v4 you started to get a deprecation warning String based operators are now dep

docs.sequelizejs.com

 

'πŸ“ŒCS > DB' μΉ΄ν…Œκ³ λ¦¬μ˜ λ‹€λ₯Έ κΈ€

[DB] N + 1 문제  (0) 2021.04.11
[DB] Index  (1) 2021.04.04
[SQL] 닀쀑정렬 ORDER BY  (1) 2020.01.09
[MySQL] Resotre Workspace 였λ₯˜  (0) 2019.12.10
[MySQL] MySQL λΉ„λ°€λ²ˆν˜Έ λ³€κ²½ 방법  (0) 2019.05.22

λŒ“κΈ€