【发布时间】:2021-09-03 01:08:29
【问题描述】:
我有下面的文档,我需要将一个对象插入到播放器数组中如何使用 mongoDB 执行此操作
{
"data": {
"createTournament": {
"_id": "6130d9a565aa744f173a824a",
"title": "Jogo de truco",
"description": "",
"status": "PENDING",
"size": 8,
"prizePool": 20,
"currency": "USD",
"type": "Battle",
"entryFee": 1,
"startDate": "2021-09-01",
"endDate": "2021-09-01",
"rounds": [{
"round": 1,
"totalMatches": 4,
"matches": [{
"match": 1,
"players": []
}
]
}]
}
}
}
【问题讨论】:
-
第一步:弄清楚如何通过 shell 来做。见stackoverflow.com/questions/27874469/… 和stackoverflow.com/questions/36113069/…