1
vote
0answers
26 views

Slow insert and update in mongo using node.js as compared to Java

I am writing stand alone script to insert some 5000 records in a collection. I am updating another collections using the same 5000 records. My issue is when i write this using java with mongo it takes ...
0
votes
0answers
15 views

Handling unknown number of aggregation operations

I want to write a generic code that will create aggregations if needed for a query, depending on the filters I got from the API call. So, for example, I might create 'match' aggregation for ...
0
votes
1answer
31 views

Transaction atomicity with MySQL, MongoDB, RabbitMQ

I have a Java project with these 3 datasources: MySQL, MongoDB, RabbitMQ. I'm trying to find a way to execute "transactions" (because MongoDB isn't, in fact, transactional) on all 3 datasources as a ...
0
votes
0answers
23 views

Morphia stops when inserting objects with predefined ids

I need to insert a list of objects with a predefined _id (Long) into a collection. insert(object) method for a single object from AdvancedDatastore works great. The trouble begins when i try to use ...
0
votes
0answers
28 views

mongoDB: $inc of a nonexistent document in an array

I was not able to write a code, which would be able to increment a non-existent value in an array. Let's consider a following structure in a mongo collection. (This is not the actual structure we ...
3
votes
1answer
74 views

Devise confirmation tokens in Java

Can't seem to create a functional way to insert a user from Java for Devise. Currently there are these fields: "_id", "access_level", "confirmation_sent_at", "confirmation_token", ...
0
votes
2answers
22 views

Why is it that I add ORG.mongodb.smth to dependencies and then import COM.mongodb.smth?

I'm doing this from within code in a Scala/SBT project, but I assume this question should equally well apply to Java code. In build.sbt I have: libraryDependencies += "org.mongodb" %% "casbah" % ...
0
votes
0answers
10 views

MongoTemplate upsert - easy way to make Update from pojo (which user has editted)?

Here is a simple pojo: public class Description { private String code; private String name; private String norwegian; private String english; } And please see the following code to ...
0
votes
0answers
22 views

How can Fix the TypeNotPresentExceptionProxy exception in java?

I am working in a java application and got the exception while migrating my users from postrgre sql db from mongo db getting the exception for the particular id, 2013-11-15 17:08:21,036 ERROR ...
0
votes
1answer
47 views

MongoDB handling failure of insert in Java

I would like to handle failure of insert to collection (using Java) in order to be sure that my insert was successful. In case that insert fails, I want to perform some fall-back action. Assuming ...
0
votes
1answer
31 views

How to delete in MongoDB records whose hour is not a multiple of 12

I am using MongoDB through the Casbah driver and I am storing documents which contain a date field, which is in my java world a Java DateTime. I would need to perform similar queries: Remove all ...
0
votes
0answers
18 views

Modeling nested documents with Spring-Data-MongoDB

I have a MongoDB database that represents snippets of public gene information like so: { _id: 1, symbol: "GENEA", db_references: { "DB A": "DBA000123", "DB B" ["ABC123", ...
2
votes
1answer
39 views

Morphia mapping Generics

To simulate the behavior I see I wrote this test (gives the same exact error): @Test public void testListGenerics() { @Entity class BaseOne<T> { @Id ObjectId _id; ...
0
votes
1answer
26 views

Lazy Loading of References

I have a java class with a member: @Entity public class TypeA { ... @Reference(lazy = true) private TypeB anObj; ... } Now when I do a datastore.find(TypeA.class).asList().get(0), the ...
1
vote
1answer
14 views

MongoDB batch insert not working with java driver 2.11.2

MongoDb 2.4.7 mongo-java-driver-2.11.2.jar Windows 7 So im trying to load test mongodb by inserting a batch of inserts to judge how much throughput it can handle. if do the insert one at a time it ...
0
votes
1answer
51 views

Efficient handling of saving Object data with image in MongoDB

Here i want to save one object to MongoDB using Java. I found Morphia, Jongo, Springs are providing framework to achieve it. To store the images to mongoDB i found GridFS Here my problem is, 1. I ...
2
votes
2answers
51 views

Do I need to explicitly close connection?

I'm holding one instance of MongoClient and DB in my application, and every time that I want to execute some operation I call getCollection(). I'm wondering if I need to explicitly close the ...
0
votes
0answers
33 views

Using MongoDB in Android Studio 0.3.4 [closed]

I would like to use MongoDB in my Android Studio App, but I haven't found any method to do it, neither online documentation. The only thing that I've found are the Mongo Java Drivers, but I don't have ...
1
vote
2answers
27 views

Spring Mongo Upsert nested document

I am new bie to spring framework. I have my mongo document like { "_id" : ObjectId("527242d584ae917d8bd75c7b"), "postTitle" : "Car", "postDesc" : "rent", "owner" : ...
0
votes
1answer
53 views

Java Eclipse(android) couldn't insert data to mongodb database

Sorry up front, I'm a newbie in mongodb connection code I try to insert database from eclipse (android) to mongodb but nothin happen in my database When I check in mongo.exe with "show dbs" local ...
-1
votes
1answer
40 views

How to perform match on sum of two fields

I have a query in MySQL that contains the following condition: WHERE START_TIME < ? AND START_TIME+DURATION >= ? How should I migrate this to MongoDB using Java driver and aggregation ...
0
votes
2answers
58 views

How to calculate a timely list of GPS points in a given radius in memory (Java)?

I know this would be quite easy to do with PostGIS in a database, but I only expect my points to live for a couple of minutes max. I would like to have a list of GPS points that live for 1-5min. When ...
0
votes
2answers
59 views

How to download file in Spring mvc and mongodb

Hi have written controller class like below. I am trying to get file from mongo db and try to download it. organizationFileAttachmentService.setUser(getUser()); GridFSDBFile file = ...
1
vote
1answer
59 views

Possible to set mongodb writeconcern to only ignore Duplicate Key errors?

On an insert into mongodb, can I set the writeconcern to something that will only ignore Duplicate Key errors? I want to completely ignore these errors, but still catch if something else went wrong. ...
1
vote
1answer
31 views

Basic MongoOperations call returning zero

Just started using MongoDB with JAVA. Set up the following JavaObject package com.foo.bar import org.springframework.data.annotation.Id; import ...
0
votes
2answers
46 views

$unwind Addresses from Person collection with MongoDB using Jongo

Hi I am having problems using Jongo to get a list of Addresses from my collection of Persons using the $unwind operator. As you can see I defined the Person class as follows: public class Person { ...
0
votes
0answers
26 views

MongoDB exchange Out Body is null, using Apache Camel

I am trying to save some data in MongoDB using apache Camel. Following is my code from("direct:saveData") .process(dataSaveRequestProcessor) .streamCaching() ...
1
vote
1answer
27 views

Jongo Update query is not working

I am new with Jongo and mongoDB. I am trying to update my mongodb document with the new Java object but its not working. Is there any dependancy/versioning issue of jongo? I couldn't find any ...
0
votes
2answers
55 views

mongo couldn't connect to [localhost/127.0.0.1:27017]

I'm getting the following error: נוב 08, 2013 12:05:46 PM com.mongodb.DBTCPConnector initDirectConnection WARNING: Exception executing isMaster command on localhost/127.0.0.1:27017 ...
0
votes
2answers
43 views

Mongodb Exception String index out of range: -1

Hi i tried a program on mongodb which connect to mongohq but i am getting following error : Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at ...
0
votes
1answer
22 views

Problems using yaml and mongodb

I have a yaml file (third party file that I dont have control over). I need to get this into my mongodb. But when I try inserting it into my collection, I get the below exception ...
0
votes
1answer
25 views

MongoDB find with regex behaves differently from Java

Regex find with MongoDB 2.4.6 is not behaving the same way as the Java Pattern class does. Can anyone explain why? Inserting data in MongoDB: db.Project.insert({ "_id" : ...
0
votes
1answer
34 views

MongoDB Timestamp Java Driver Date

I am trying to get my date formatted in MongoDB so that it is not a string but an internal BSON date on each record so I can do TTL stuff. I am using the Java driver and the new Date() method but the ...
0
votes
1answer
44 views

Storing a large number of geolocation records in cached ArrayList or always query them from MongoDB?

I'm working on a geolocation app. This app holds about 500K records in a MongoDB properly indexed. Each row has its own latitude and longitude recorded values. Thus, a client must recover 200 nearest ...
0
votes
1answer
46 views

mongodb multi tenacy spel with @Document

This is related to MongoDB and SpEL Expressions in @Document annotations This is the way i am createing my mongo template @Bean public MongoDbFactory mongoDbFactory() throws UnknownHostException { ...
1
vote
2answers
50 views

MongoDB Query Help - query on values of any key in a sub-object

I want to perform a query on this collection to determine which documents have any keys in settings that match a certain value. Is this possible? I have a collection of documents like: { ...
0
votes
2answers
40 views

MongoDB Java Driver

Given some JSON value and a query in MongoDB format, I want to filter the same way that MongoDB does, the json entities I want without going to the MongoDB. For example, I have: JSON Value: [{qty: ...
0
votes
1answer
38 views

How to store queries inside a MongoDB collection in order to execute them dynamically?

I'm new at MongoDB. I have a "Report" dropdown in my interface and depending of the report selected a query is executed. On the other hand I have a "reports" collection for example like this: { ...
-1
votes
0answers
26 views

How to compress and decompress Values in Java Map

I am developing an application using java. I have to compress and save Map in Mongo DB table and during retrieval i have to decompress saved map value. Presently we use LZ4FastDecompressor for ...
0
votes
1answer
32 views

Java mongodb connecion to remote server

I have amazon ec2 windows instance running, and i have associated elastic ip to it. I have installed mongoDB on this instance. When i try to connect to this remote mongodb database using java it gives ...
0
votes
0answers
43 views

Connect Mongo DB with Android application

Im trying to build android app to connect to MongoDb. Stuck to this problem. MongoDB is accesible and without security. It is posible to add data with Mono Explorerfrom phone. public void ...
0
votes
1answer
31 views

Hopw to make a multiple anchor regex query against an index in mongo

I'm searching indexes using regular expression anchors like so: /^[Anchor1]/ and it's all well and good. It matches all values that start with "Anchor1" and it uses the idex to do so. However, I ...
0
votes
2answers
39 views

Disable primary key index in MongoDB and enable it after bulk insterting?

Is it possible to disable primary key index in MongoDB and enable it after bulk inserting? The reason is performance during heavy bulk insert. I'm using JAVA.
0
votes
0answers
54 views

Mongo db read on big collection

I have an ETL process that needs to pull data from a very large Mongo collection (150 million documents). I was originally using Spring data's template like this: ...
1
vote
1answer
48 views

Jackson Serialize Map to List

Internally, I use a map for a quick lookup of values, e.g. private Map<String, CustomObject> lookupTable, where the CustomObject has some id field that is being used as the key in the ...
0
votes
1answer
57 views

Why is this method ambigous?

I have the following class: public abstract class AbstractMongoDAO<T extends AbstractChiliEntity> implements IDAO<ObjectId, T> { // Method 1 protected List<DBObject> ...
0
votes
2answers
50 views

Converting JSON to entities and storing in mongoDB using morphia

I have a JSON string being sent from a client (browser ).I want to save it to my mongoDB database which already has some collections defined by the user.I was able to successfully save objects using ...
0
votes
2answers
35 views

Increase efficiency in comparing one field with multiple collection Mongodb Jdbc

Hi , I have one SQL query i'm trying to implement it in MongoDB using MongoJava driver Jdbc [2.10]. My sql query is, SELECT DISTINCT table1.id FROM table1,table2 WHERE table1.x = table2.x and ...
0
votes
1answer
22 views

Jade agent with Mongo Database issue

I'm trying to use Mongo Database from within my Agent (using Jade agent framework). Trying to write something to database from Agent somehow did not succeed with NoClassDefFoundError. The code is ...
2
votes
2answers
53 views

MongoDB and multiple upsert

I am relatively new to MongoDB, but we consider using it as some sort of cache in front of a legacy service. In this case, we have stumbled across some issues. First, some explanation. This caching ...

15 30 50 per page