Skip to content
Advertisement

How to query mongodb with query Builder in java?

I need to make a query in java to MongoDB, how could I do it with QueryBuilder, this is my query:

JavaScript

By the way, if anyone knows where I can find documentation to make these queries, I would appreciate it.

Advertisement

Answer

You should Refer this documentation

Create a MongoCollection object. Create a list to have aggregate pipelines Aggregates is a class where you will have all valid pipelines. Pass the list to aggregate function of the MongoCollection object.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement