Tagged Questions
2
votes
0answers
21 views
Selecting only one column in mongo db using morphia
I have 2 columns String id, String Name and long age.
As we would have done in sql - select id FROM USERDETAILS Where Age > 5 would give me arrayList of primary keys that is "Id".
can anyone tell me ...
2
votes
0answers
241 views
mongodb java driver query with regexp number fields
I'm trying to convert this query in java:
db.beni.find({ $where: function() {
return /.*11/.test(this.foglio) || /.*99/.test(this.comune) } })
Where this.foglio is a numeric field and this.comune ...
1
vote
0answers
53 views
MonoDb creates connection every single operation on collection
I'm using mongodb-java-driver, and nothing else except that. I created singleten EJB with connection to Mongo.
@Singleton
public class MongoConnection {
private DB db = null;
private MongoClient ...
1
vote
0answers
291 views
Loading text file from Hdfs to MongoDB
While trying to load a text file from HDFS to MongoDB through a map-reduce java program,i am getting the following error:
12/07/26 19:19:02 INFO jvm.JvmMetrics: Initializing JVM Metrics with ...
0
votes
0answers
15 views
MongoInternalException: DBPort.findOne failed while running on GAE localserver
I am trying to connect to remote MongoDB (mongolab) from my local GAE server (localhost/8888). I am using morphia and my mongodb driver version is 2.4. My code looks like this:
Mongo m = new ...
0
votes
0answers
85 views
Raw javascript mongodb queries using db.eval() in java
currently I'm working on a project in JAVA, and I need to run the Javascript Mongo queries through JAVA, and I figured I can do something like that using db.eval() in java. Problem is I have the ...
0
votes
0answers
101 views
how to update nested objects in array that match the condition in spring data - mongodb?
I have a document in mongodb that has been created from this java model:
class Comment
{
String pollID;
List<CommentDetail> commentDetailList;
}
class CommentDetailList
{
String ...
0
votes
0answers
162 views
MongoDB: WriteResult.getN() always returns 0?
According to the javaDoc, getN() method of WriteResult class in MongoDB-java returns the number of documents updated in the opertion.
But it always returns zero, even if the document is inserted ...
0
votes
0answers
73 views
Rename fields in a mongo query without $rename in JasperReports
I have the following mongo query:
{
'collectionName': 'systemMetrics',
'findFields':{
'lang':1,
'$P!{SystemMetric1}':1,
...
0
votes
0answers
70 views
Out of heap space while building big BasicDBObjects in JRuby
i am using JRuby 1.7.0.preview1 for an application.
This application stores many Documents in Mongodb.
My Problem is, my documents are very big and have a deep structure.
When i build those ...
0
votes
0answers
254 views
mongodb java - getting Id value
I have two collections
testone
{"_id":1,"name":"alex"},
{"_id":2,"name":"sandy"}
testtwo
{"_id":11,"password":"alex",tenant_id:{$ref:"testone","$id":1}}
...
0
votes
0answers
47 views
Connect exception for mongodb in java
public static void main(String[] args){
try{
Mongo mongo = new Mongo();
DB db = mongo.getDB("appname");
DBCollection coll = db.getCollection("test");
...
0
votes
0answers
782 views
How to store HTML data in MongoDB?
I'm trying to crawl the web and store HTML data on MongoDB using Java. Unfortunetely while storing data, MongoDB drivers nulling the data and stores empty field for HTML data.
When I get the first ...
0
votes
0answers
51 views
mongodb as input for tilestache
Is there a way to import GeoJSON data directly to TileStache from a mongoDB? I know this is possible for PostGIS, but I am not able to find something similar for mongodb. The only possibility I am ...
0
votes
0answers
299 views
Log4mongo for Java: Could not instantiate appender named MongoDB
Log4j.properties file
log4j.rootLogger=ERROR, MongoDB
log4j.appender.MongoDB=org.log4mongo.MongoDbAppender
log4j.appender.MongoDB.databaseName=appName
log4j.appender.MongoDB.collectionName=test
...