mongodb « mongodb « Java Database Q&A





1. Is MongoDB a valid alternative to relational db + lucene?    stackoverflow.com

On a new project I need a hard use of lucene for a searcher implementation. This searcher will be a very important (and big) piece of the project. Is valid or ...

2. Working with mongodb from Java    stackoverflow.com

I have launch mongodb server:

[demas@arch.local.net][~]% mongod --dbpatmongod --dbpath /home/demas/temp/  
Mon Apr 19 09:44:18 Mongo DB : starting : pid = 4538 port = 27017 dbpath = /home/demas/temp/ master = 0 ...

3. Directory Hierarchy    stackoverflow.com

How to build a folder structure using morphia or the mongodb API? I am looking for something like this.

folderA
--->folderB
--->folderC
------>fileC
------>folderCA
---------->fileCA

4. How to get a properly typed List from a ReflectionDBObject    stackoverflow.com

I have a model classes like

public class MyClass extends ReflectionDBObject {
    private List<NiceAttribute> attributes;    
    ...
}

public class NiceAttribute extends ReflectionDBObject {
  ...

5. Java API for MongoDB    stackoverflow.com

What is in your experience a good Java API for MongoDB? I am searching for something with annotation based mapping of Java POJOs to MongoDB resources and a decent ...

6. mongoDB utility class    stackoverflow.com

Is there a "MongoUtil" class that allows me to get a new connection in a multi-threading environment (like the so famous HibernateUtil class)? Thanks

7. Secondary-only nodes in mongodb Replica set    stackoverflow.com

I am working on a project where I want to have the ability to specify that certain nodes of the replica set can never be primary nodes ie in case of ...

8. mongoDB injection    stackoverflow.com

is there a common pattern in Java to avoid mongoDB injection attacks? Thanks

9. How to get values of inner document attribute in mongoDB?    stackoverflow.com

i am new to mongoDB. I am using mongoDB in web app. I want to know how to get the value of inner document attribute of a document. Lets say my JSON ...





10. What kind of tools are available for populating test data into mongodb    stackoverflow.com

What kind of tools are available for populating test data in mongodb. We have used dbunit in the past, but it doesn't seem to have an equivalent maven plugin. ...

11. MongoDB equivalent of WHERE IN(1,2,...)    stackoverflow.com

I have a list of userIDs and I want to pull out every document (naturally ordered) from a collection that are associated with one of these user IDs. Is there a ...

12. MongoDB API for Java : MongoInternalException on accessing a DBCursor    stackoverflow.com

After successfully connecting to the MongoDB database, I'm receiving this exception when trying to go through a DBCursor :

Exception in thread "main" com.mongodb.MongoInternalException: couldn't get next element 
    ...

13. How to specify Multiple conditions in Java Mongo    stackoverflow.com

HI, I have a code which requires me to get user details from a mongo database collection Following is one of the field in my Users collection

"emailSettings" : {
    ...

14. Mongo/Java findAndReplace not working    stackoverflow.com

I have a Mongo collection like this

email{
"isConfirmed" : true/[or false]
"email" : "xxxxxxxxxxx"
}
When I am trying to update the isConfirmed field to true or false, depending on the email which apparently is ...

15. mongo + java + too many open files    stackoverflow.com

I am using mongo-java2.4jar for communicating with the mongo server. In my webapp i am using mongo=new Mongo("serverIp","port") where ever it is required and once the processing is complete, i am closing ...

16. Mongo+Java+SocketTimeOut    stackoverflow.com

I am using MongoDb and I am facing problems while reading the records from the DB. I am able to get them in the cursor but when I try to get the ...





17. How to specify UUID in mongo $where clause    stackoverflow.com

I have an object that was stored via mongo-java-driver. Object uses java.util.UUID for its _id field. Following is presentation of object via mongo shell:

> db.b.find()
{ "_id" : BinData(3,"zUOYY2AE8WZqigtb/Tqztw==") }
I have a ...

18. mongodb: storing a hierarchical tree structure?    stackoverflow.com

on the mongodb, how would I go about storing a hierarchical tree data in which each node contains a Java object containing it's own set of string variables and objects? If ...

19. Java - memory usage & multiple instances of jar    stackoverflow.com

I am currently working with Java, MongoDB and several threads. For each threads, I run MongoDB connection.

private Mongo m;
m = new Mongo();
I had a look to the memory usage with TOP and ...

20. Read issue in MongoDB asynchronous replication    stackoverflow.com

I'm new to MongoDB. I created a Java app using MongoDB as database. I configured 3 servers in a replica set. my pseudo code: { createUser getUser updateUser } Here createUser creates the user successfully but getUser fails to ...

21. java.lang.ClassCastException even though I am casting it to the extended class    stackoverflow.com

I am trying to setup a mongo-hadoop driver extensions for the hadoop streaming jobs I have written for the python plugin dumbo. The dumbo project needs me to ...

22. MongoDB Java API: put() vs append()    stackoverflow.com

I am new to mongodb and as I going through the tutorial for Java & Mongodb. I notice there is put() and append() for BasicDBObject and I took a look at ...

23. Java - InstanceAlreadyExistsException with Mongodb    stackoverflow.com

I am doing multithreading with Mongodb and sometimes I have this message when running my script :

8 juil. 2011 14:13:59 com.mongodb.DBPortPool$Holder get
ATTENTION: jmx registration error: javax.management.InstanceAlreadyExistsException: com.mongodb:type=ConnectionPool,host=180.20.0.20,port=27017,instance=1593488603 continuing...
I checked on Mongodb ...

24. Setting a inner document attribute in MongoDB with Java API    stackoverflow.com

I am struggling to figure out the correct way to update/insert a new attribute into an inner document. Everything i am trying is just not working.

{ "a" : true, ...

25. java - MongoDB + Solr performances    stackoverflow.com

I've been looking around a lot to see how to use MongoDB in combination with Solr, and some questions here have partial responses, but nothing really concrete (more like theories). In ...

26. Cloud for Flex, Java, mongoDb?    stackoverflow.com

I am about to develop my masters project using Flex as front end, BlazeDs, Java Web Services and MongoDB in the backend. I am looking to deploy and manage it on ...

27. Dealing with schema changes in MongoDB    stackoverflow.com

I use MongoDB in one of my Java projects. After a DB schema change, I found myself modifying existing code at a lot of places to perform the change from e.g.:

Object ...

28. Can I use MongoDB for Java Content Repository?    stackoverflow.com

Can I use MOngoDB for JCR storing file (xml file)?

29. mongodb+mockito doesn't work together?    stackoverflow.com

I'm trying to setup mocks for mongodb in my java code, and I'm getting the following exception:

org.mockito.exceptions.misusing.WrongTypeOfReturnValue:
DBCursor$$EnhancerByMockitoWithCGLIB$$fc4f0e22 cannot be returned by getOptions()
getOptions() should return int
The line of code that generates this ...

30. mongodb dbrefs examples using Java    stackoverflow.com

I tried to find working examples of java/SpringData mongodb DBRefs but couldn't find any. I'm new to Mongodb and looking for ways to use SQL join-like functionality to aggregate/merge data from ...

31. Storing and getting documents from MongoDB    stackoverflow.com

I need to provide a way that my mongodb server will store each document id as long integer (64-bit) starting from 0 and increment as document is inserted. Here's a kind of ...