我有一个Mongoengine ORM,它映射了以下关系(简化): class UserInfo(mg.Document): allcharacters= mg.ListField(mg.ReferenceField("Character")) charid =["user"])[0].allcharacters:
if x</
我将用一个虚构的例子来解释(这个例子使用mongoengine)# File 1 importmongoengine as me
residents: me.ListField(me.ReferenceField(persons.PersonThis will be a list populated with Person objects
# File
作为来自DynamoDB的人,建模一个真正适合我的应用程序的MongoDB模式是有点令人困惑的,特别是因为它有引用的概念,并且根据我所读到的内容,不建议保留重复的数据来容纳您的查询。以下面的示例为例(在mongoengine中建模,但不重要): class User(Document): roles =