How should the model design be?

瀏覽次數:12 次
跳到第一則未讀訊息

Burhan GÖKSEL

未讀,
2022年7月26日 上午10:29:472022/7/26
收件者:MongoEngine Users
Greetings To You All,

Query get method works, but insert with mutation does not.

My Model:
class Artifact(Document):
name = StringField()
list = ListField(DictField())

My Query:
"data": {
    "x": [
      {
        "id": "62dfe8a35de7c5c67a51d7e2",
        "name": "burhan",
        "list": [
          "{\"name\": \"burhan\", \"gender\": \"man\", \"age\": \"24"}",
          "{\"name\": \"burhan\", \"gender\": \"man\", \"age\": \"24\"}"
        ]
      },
      {
        "id": "62dff1b21a559df6e94838ac",
        "name": "id",
        "cef": null
      }
    ]
  }

Thank you very much in advance to those who help.

Clara Daia

未讀,
2022年7月26日 上午10:59:192022/7/26
收件者:mongoeng...@googlegroups.com
Hi Burhan,

Can you show the code you are running with the mutation and the error message?

By the way, I would not call your attribute "list" as "list" is also a built-in function and it can cause problems down the line.

Best,
Clara

--
You received this message because you are subscribed to the Google Groups "MongoEngine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongoengine-us...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongoengine-users/1d940891-5596-413f-95d6-f14029dba4d1n%40googlegroups.com.
回覆所有人
回覆作者
轉寄
0 則新訊息