MongoDB is a scalable, high-performance, open source, document-oriented database. This tag is used for questions related to the Java language bindings and drivers for MongoDB.
0
votes
1answer
31 views
Netty HTTP + MongoDB: Unlimited Increment in connections
I'm now using Netty as my backend webservice and MongoDB as my database.
At first, I'm very glad with the high performance of the combination of MongoDB and Netty.
But recently I checked the MongoDB ...
0
votes
1answer
22 views
When does MongoDB Java Driver makes connection?
I am using latest Java Driver (2.11.1) for MongoDB.
MongoDB Java API essentially is
One instance of MongoClient class (with internal connection pool)
getDB() for getting DB object
getCollection() ...
0
votes
2answers
35 views
MongoDB - Inconsistent representation of binary data using C++ and Java drivers
I need to keep some binary data in my MongoDB collection. It seems that I'm getting different JSON representation of my documents when retrieving the same record using either the C++ driver or the ...
0
votes
2answers
40 views
Connect to remote mongodb server with java
I'm trying to connect to a remote mongodb instance, but it keeps throwing an error.
Java code:
Mongo mongo = new Mongo("172.234.52.24");
DB db = mongo.getDB("myDB");
collection = ...
0
votes
2answers
64 views
mongoDB selecting record based on two conditions
A sample record in my database looks like :
{
"_id" : 2,
"name" : "Corliss Zuk",
"scores" : [
{
"type" : "exam",
"score" : ...
0
votes
1answer
13 views
Save a javascript code as store function via Java API
I want to save a javascript code as store function via Java API. The problem is that I don't know how to convert String (type 2) to code (type 13). I know that in PHP it's possible:
new ...
0
votes
1answer
30 views
java DBCursor for MongoDB
JavaDoc for DBCursor says that results are lazy-fetching from the database. But
public class DBApiLayer extends DB {
...
private void init( Response res ){
...
_cur = ...
0
votes
1answer
69 views
Save an object with image ( save both object data and image too) inside mongoDB using Java
I want to know specifically about saving an object with an image inside it. What I want to do is saving an entire object with image inside it, Image must be saved. I tried this but it saves only File ...
0
votes
1answer
33 views
How can I do mapping from AggregationOutput to a POJO?
For a complicated query I descended to MongoDB Java API (using Spring-data for most of my stuff) and I wrote a aggregate statement using BasicDBObjects.
DBCollection users = ...
0
votes
1answer
28 views
Click counter implementation with MongoDB - asynchronous write
I would like to implement a click counter using MongoDB (e.g. user clicks a link, count the total clicks).
My intuitive approach is to have an in-memory low priority thread pool that will handle a ...
0
votes
1answer
74 views
Connect to remote MongoDB replica set, when replica set connect to each other on local IP addresses
We have setup a mongo replica set on a local network interface (i.e. 192.168.1.x). The replica set members are the only ones that know about this interface. The instances are also on an external ...
0
votes
1answer
33 views
How can I configure Tomcat to access mongodb remotely?
Both Tomcat and Mongo run on the same machine. There are no settings for this configuration. Now I need my Tomcat to connect to an other Mongo (on the other machine).
How can I do it?
0
votes
1answer
90 views
Can't find MongoClient in Java Drivers
In reading all the documentation on the mongo site for using the Java Driver, it makes references to using MongoClient() to make a connection. It talks about how they formerly used Mongo() but it has ...
3
votes
3answers
50 views
I store a JAVA date with UNIX timestamp in MongoDB and got a wrong anwser
I met a big problem that got my DB terrible when I store a UNIX timestamp into MongoDB.
Here's the code:
DBObject tmp = new BasicDBObject("_id", basicUrl+ob.getString("id"));//new a DBObject,it ...
1
vote
1answer
32 views
Got unauthorized error when renaming mongodb collection
I am using mongohq sandbox plan. In the command prompt,
db["oldCollectionName"].renameCollection("newCollectionName", true)
works fine without using admin database.
However, I got "unauthorized" ...