driver « mongodb « Java Database Q&A





1. mongodb java driver - raw command?    stackoverflow.com

Is it possible to execute raw commands as javascript through the Java driver for MongoDB? I'm tired of wrapping everything in Java objects using Rhino, and would happily sacrifice performance for the ...

2. Which is the best java driver for mongodb access?    stackoverflow.com

I have no experience with MongoDB and we are trying to port a JPA application to be based on MongoDB. There are 3 drivers mentioned for porting java here. ...

3. How do I update fields of documents in mongo db using the java driver?    stackoverflow.com

References:

Still pretty new to mongo db but I'm trying to update part of an existing document inside a collection... unfortunately, the link above doesn't have an update example. Essentially, i ...

4. How do I limit the number of results when using the Java driver for mongo db?    stackoverflow.com

http://api.mongodb.org/java/2.1/com/mongodb/DBCollection.html#find(com.mongodb.DBObject,com.mongodb.DBObject,int,int) Using this with Grails and the mongo db plugin. Here's the code I'm using... not sure why but the cursor is returning the entire set of data. In this ...

5. Java MongoDB Driver Connection Question    stackoverflow.com

Im using the MongoDB Java driver in a java web app. One question I want to ask is do i run Mongo.close() whenever Im doing doing a query , or can ...

6. MongoDB Java Driver Array    stackoverflow.com

I am trying to save a set of tags within a mongodb document e.g. { id:"104454", tags:["tag1", "tag2"] } I am struggling to figure out how to do this with the Java Driver though. I thought ...

7. Getting nested Document from mongo db using java Driver    stackoverflow.com

I need to create an Object graph for the documents in a collection. I am able to get all the key-value pairs. Here is the code which does that:

import com.mongodb.*;
import java.util.*;

public class ...

8. MongoDb's $set equivalent in its java Driver    stackoverflow.com

Is there a way in which I can modify the value of one of the keys in MongoDb via its Java Driver. I tried out the following:

someCollection.update(DBObject query, DBObject update);
someCollection.findAndModify(DBObject query, ...

9. Getting mongoStat through mongoDB Java driver    stackoverflow.com

Is there a way to get the results of the mongostat utility such as no. of queries/sec, inserts/sec, etc. through java driver. One way I find out was to ...





10. Mongo java driver - retrieve slice of array without any other field    stackoverflow.com

I have a class called user which can be simplified to:

class User {
    String[] friends;
    //Constructor etc...
}
It is stored in a mongo collections called users. ...

11. How to set up ReportsAnywhere to connect to MongoDB?    stackoverflow.com

Supposedly ReportsAnywhere will talk with MongoDB to generate reports. I am not sure if it is using the JDBC driver or a different method. Hoping ...

12. How to install a JDBC driver in BIRT Reporting for Eclipse    stackoverflow.com

Possible Duplicate:
MongoDB and BIRT Reporting?
I am trying to install a JDBC driver in to eclipse - specifically the BIRT tool in eclipse. I ...

13. What is the performance impact of using Casbah as opposed to directly using MongoDb java driver?    stackoverflow.com

Casbah is another layer on top of Java driver for MongoDb. Would this reduce performance of queries and updates in MongoDb database in scala projects when using Casbah as ...

14. How to get id of model saved in mongodb using java driver or morphia?    stackoverflow.com

There is a tutorial http://code.google.com/docreader/#p=morphia&s=morphia&t=QuickStart But it leaves out the detail how to get the id of the hotel.

Morphia morphia = ...;
Datastore ds = morphia.createDatastore("testDB");

String hotelId = ...; // the ...

15. How to configure MongoDB Java driver MongoOptions for production use?    stackoverflow.com

I've been searching the web looking for best practices for configuring MongoOptions for the MongoDB Java driver and I haven't come up with much other than the API. This search started ...

16. Updating an array in MongoDB using Java driver    stackoverflow.com

I'm using MongoDB with the official Java driver (version 2.6.3). I have a MongoDB collection that contains shopping lists. A shopping list has the format

{ "_id" : { "$oid" : "4e2af1f43f8de96494d5271d"} ...





17. how to check from a driver, if mongoDB server is running    stackoverflow.com

I wonder, if there is a way to check if mongoDB server is running from java driver for mongoDB? According to the tutorial, I can do

Mongo m = new Mongo();
// ...

18. Why is the MongoDB Java driver / Morphia prepending a property twice?    stackoverflow.com

Here are my (sample) objects. I haven't put any other annotations besides what's required for Morphia:

package jungle;

@Entity
public class Monkey {
   String name;
   int bananas;
   ...

19. Improve performance in Mongodb using java driver    stackoverflow.com

I wanted to integrate MongoDB in my applicaion. I have tested using Apache Banchmarking tool and produce 1,00,000 incoming request with 1000 concurrency level. After some test of insertion of records ...

20. MapReduce using MongoDB Java Driver failes with wrong type for BSONElement assertion    stackoverflow.com

I'm pretty new to MongoDB and MapReduce. I need to do some MapReduce on a collection in my DB. The MAP and REDUCE_MAX functions work, since I was able to accomplish ...

21. Convert DBObject to a POJO using MongoDB Java Driver    stackoverflow.com

MongoDB seems to return BSON/JSON objects. I thought that surely you'd be able to retrieve values as Strings, ints etc. which can then be saved as POJO. I have a DBObject (instantiated as ...

22. In the MongoDB java driver, how do I pass a key function ('keyf') to a 'group' command    stackoverflow.com

I would like to be able to use the mongodb group command with the 'keyf' parameter through the java driver. Has anyone been successful with this?

23. Change max batch size in MongoDB Java driver    stackoverflow.com

I came across the Javadoc of DBCursor in the MongoDB Java driver (http://api.mongodb.org/java/2.6/com/mongodb/DBCursor.html#batchSize(int)). There it is mention that the maximum batch size overall is 4mb. Is this related to MongoDB ...