如何使用MongoRepository在SpringBoot中发出mongodB嵌入式请求?

我有两个收藏夹:

  • 具有“ teacherId”和“ subjectId”字段的“会话”
  • “主题”,其字段为“ id”,“ name”和“ nbhours”。

我期待制作一个函数[ { "id": "bitcoin","symbol": "btc","name": "Bitcoin","image": "https://assets.coingecko.com/coins/images/1/large/bitcoin.png?1547033579","current_price": 9409.45,"market_cap": 173153275856,"market_cap_rank": 1,"total_volume": 30609526190,"high_24h": 9582.42,"low_24h": 9350.51,"price_change_24h": -29.23718676,"price_change_percentage_24h": -0.30976,"market_cap_change_24h": -986277704.740356,"market_cap_change_percentage_24h": -0.56637,"circulating_supply": 18388787.0,"total_supply": 21000000.0,"ath": 19665.39,"ath_change_percentage": -52.07157,"ath_date": "2017-12-16T00:00:00.000Z","atl": 67.81,"atl_change_percentage": 13799.79978,"atl_date": "2013-07-06T00:00:00.000Z","roi": null,"last_updated": "2020-05-29T18:15:23.854Z" } ] ,该函数可以通过TeacherId检索在会话中确定的所有主题。 换句话说,如果它是一个sql请求,它将是这样的:

getSubjectsByTeacherId(id_passed_as_parametre)
iCMS 回答:如何使用MongoRepository在SpringBoot中发出mongodB嵌入式请求?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2242878.html

大家都在问