第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何通過 json 中的深場在 mongo 排序中獲得 20 個文檔?

如何通過 json 中的深場在 mongo 排序中獲得 20 個文檔?

Go
FFIVE 2022-06-01 15:46:08
我在 MongoDB 中的文檔:{  "_id": {    "$oid": "5e90276937b54857689435733"  },  "user_id": "",  "nickname": "",  "platform": ""  "invites": {    "$numberInt": ""  },  "hide_game_stats": false,  "game_data": {    "player_info": {      "level": {        "value": {          "$numberInt": "96"        },        "rank_icon_url": ""      },      "platform": "battle"    },    "warzone": {      "battle_royale": {        "timePlayed": {          "$numberInt": "55789"        },        "score": {          "value": {            "$numberDouble": "202485"          }        },        "kd_ratio": {          "value": {            "$numberDouble": "1.71"          }        },        "kills": {          "value": {            "$numberInt": "217"          }        },        "games_played": {          "value": {            "$numberInt": "43"          }        },        "score_per_minute": {          "value": {            "$numberDouble": "217.77"          }        },        "contracts": {          "value": {            "$numberInt": "41"          }        },        "wins": {          "value": {            "$numberInt": "2"          }        },        "top_5": {          "value": {            "$numberInt": "7"          }        },        "top_10": {          "value": {            "$numberInt": "15"          }        },        "top_25": {          "value": {            "$numberInt": "39"          }        },        "win_rate": {          "value": {            "$numberDouble": "4.7"          }        }      },      "plunder": {        "timePlayed": {          "$numberInt": "18526"        },        "cash": {          "value": {            "$numberInt": "1158"          }        },        "score": {          "value": {            "$numberDouble": "67551"          }        },        "kd_ratio": {          "value": {            "$numberDouble": "1.99"          }        },      }    }  }}我只需要 20 個文檔排序game_data.warzone.battle_royale.kills.value請告訴我,我該怎么做
查看完整描述

1 回答

?
翻閱古今

TA貢獻1780條經驗 獲得超5個贊

您不要在排序中使用 $match 操作:

findOptions.SetSort(bson.D{{"game_data.warzone.battle_royale.kills.value", -1}})


查看完整回答
反對 回復 2022-06-01
  • 1 回答
  • 0 關注
  • 132 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號