Oracle Coherence 能否支持像 MongoDb 这样的复杂查询?

发布于 2025-01-03 17:25:53 字数 229 浏览 2 评论 0原文

在 Mongodb 中,您可以编写包含对象甚至嵌套对象的多个属性的查询。 oracle coherence 支持如此复杂的查询还是一个简单的 K/V 存储?

Mongodb 查询示例:

db.reports.find({profit:{$gt:99}, classification:'gas', name:/^USA/})

是否可以对一致性进行类似的查询?

In Mongodb, you can write queries that include multiple attributes of objects and even nested objects. Does oracle coherence support such complex queries or is it a simple K/V store?

Sample Mongodb query:

db.reports.find({profit:{$gt:99}, classification:'gas', name:/^USA/})

Is it possible to do similar queries on coherence?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

天暗了我发光 2025-01-10 17:25:53

是的,您可以针对多个对象属性(包括嵌套对象)查询属于单个缓存的条目。
您可以使用过滤器API一致性查询语言来做到这一点。

上述通过过滤器表达的查询类似于:

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%"

Yes, you can query entries belonging to a single cache against multiple object attributes (nested objects included).
You can either use Filter API or Coherence Query Language to do that.

The above query expressed via Filters would be something like:

reportsCache.entrySet(new AllFilter(new Filter[] {
                    new GreaterFilter("getProfit", 99),
                    new EqualsFilter("getClassification", "gas"),
                    new LikeFilter("getName", "USA%")
            }));

or using CohQL:

select * from "reports" where profit > 99 and classification = "gas" and name like "USA%"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文