我有這樣找到一個數組的鍵記錄在文檔中
{
"_id": "test1",
"friend": {
"test2": {
"name": "ax",
"level": 1,
"intimacy": 0,
"status": 0
},
"test3": {
"name": "es",
"level": 1,
"intimacy": 0,
"status": 0
}
}
},
{
"_id": "test2",
"friend": {
"test2": {
"name": "ff",
"level": 1,
"intimacy": 0,
"status": 0
},
"test3": {
"name": "dd",
"level": 1,
"intimacy": 0,
"status": 0
}
}
}
我需要找到friend.test2的節點我我想知道我改變數據_id = test1的 的文檔中的一些記錄結構來解決這個問題。任何人都可以幫助我。 結果可能是這樣的
{
"test2": {
"name": "ax",
"level": 1,
"intimacy": 0,
"status": 0
}
}
然後你有問題,如果你不想改變結構。你所問的也很不清楚。結果中的數據來自哪裏? –
如果你的意思是幫助我,那麼你必須展示你做了什麼。否則改爲:有人爲我做我的工作。 –
@SalvadorDali我沒有意識到這句話看起來不友好,只是因爲stackoverflow有一個字數限制。我不知道該寫什麼。對不起我的英文不好。 – chatfeed