yuan321
V2EX  ›  Node.js

sequelize 中如何对一对多,多对多模型进行增删改的操作?

  •  
  •   yuan321 · Sep 10, 2022 · 4444 views
    This topic created in 1527 days ago, the information mentioned may be changed or developed.

    有没有一些浅显易懂的例子?

    2 replies  •  2022-09-10 14:57:38 +08:00
    RRRoger
    RRRoger
    Sep 10, 2022
    1
    刚接触 sequelize 不久

    一对多就直接先 create 明细 然后绑定主表 id

    多对多 model.prototype.setXXXs(xxxIds)
    chensuiyi
    chensuiyi
    Sep 10, 2022
    2
    sequelize 关联关系太麻烦了,我已经全面使用 knexjs ,还不错。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1863 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 07:00 · PVG 15:00 · LAX 23:00 · JFK 02:00
    ♥ Do have faith in what you're doing.