跳到主要内容
CNode

Mongoose里model和entity的区别

问答
Ttweyseo发布于 12 年前最后回复 12 年前
685700

entity是model生成的实例 可是两者都可对数据库操作造成影响 所以不大不明白两者之间有什么区别 就是什么时候用entity 什么时候用model

查看回复

回复 (6)

X
xiuxu123#612 年前

你看下这篇文章,这个里面有很详细的说明, https://cnodejs.org/topic/504b4924e2b84515770103dd

T
tweyseo#512 年前
引用 ravenwang@tweyseo 差不多这个意思

@ravenwang thx a lot

T
tweyseo#312 年前
引用 ravenwangmodel对应collection,entity(document?)对应collection中的document

@ravenwang 意思就是model操作表 entity操作记录?

A
alsotang#212 年前

操作数据的默认用 model,entity 只能操作自己。

R
ravenwang#112 年前

model对应collection,entity(document?)对应collection中的document

参与回复

登录后即可参与回复。登录