【发布时间】:2026-01-21 08:50:02
【问题描述】:
是否可以在 mLab 中使用 like/contains 查询? 我在服务器https://mlab.com/上有这样的json数据:
"County": "Kildare, Laois, Carlow"
我可以查询数据集以返回所有 where trails = 基尔代尔郡:
@GET("databases/walks/collections/walks")
Call<List<Trail>> byCounty (@Query("q") String county,@Query("apiKey") String apiKey);
参数“q”包含:q={"County": "Kildare"}
但只选择符合以下条件的数据:
"County": "Kildare"
是否存在与 MongoDB 中的 Contains 或 SQL 中的 Like 具有相同功能的 Mlab 查询。所以如果它包含“Kildare”,我可以搜索县域。
或者甚至如何在 HTTP 请求中执行此操作,我也许可以在 q={ } 中使用它。
我试过使用q={"County":"/.*Kildare.*/"}
谢谢。
【问题讨论】:
-
Is there a retrofit query that has the same function as Contains in MongoDB or Like in SQL- 改造不是数据库 -
改造对服务器提供数据的能力没有影响..
-
感谢更改了问题标题
标签: android mongodb httprequest retrofit2 mlab