在 Mongodb 中,您可以编写包含对象甚至嵌套对象的多个属性的查询。 oracle coherence 支持如此复杂的查询还是简单的 K/V 存储?
示例 Mongodb 查询:
db.reports.find({profit:{$gt:99}, classification:'gas', name:/^USA/})
是否可以对一致性进行类似的查询?
最佳答案
是的,您可以针对多个对象属性(包括嵌套对象)查询属于单个缓存的条目。
您可以使用 Filter API或 Coherence Query Language要做到这一点。
上述通过过滤器表达的查询类似于:
reportsCache.entrySet(new AllFilter(new Filter[] {
new GreaterFilter("getProfit", 99),
new EqualsFilter("getClassification", "gas"),
new LikeFilter("getName", "USA%")
}));
或使用 CohQL:
select * from "reports" where profit > 99 and classification = "gas" and name like "USA%"
关于mongodb - Oracle Coherence 能否支持像 MongoDb 这样的复杂查询?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9207074/