Questions tagged [mongo-java-driver]

The Java driver for MongoDB

The MongoDB Java Driver.

Using the Java driver is very simple. First, be sure to include the driver jar mongo.jar in your classpath.

The following code snippets come from the QuickTour.java example code that can be found with the driver source.

347 questions
-2
votes
1 answer

How to aggregate values in an array of objects in MongoDB

I store documents from cars and want to get the temperature of all Mercedes cars as an array, how should the query be in Mongodb? { "_id" : { "$oid" : "5880ff305d15f416c89457b7" }, "car" : "mercedes", "engine" : { "sensor" :…
-3
votes
1 answer

How to run a mongo query from java program?

The query that we run from a mongo-shell, I want to run the same query from a java program. How can I do that?
1 2 3
23
24