mongo-java Questions

4

Solved

I'm trying to query a collection using operands AND'd together. I've got the shell version working: db.widgets.find({color: 'black, shape: 'round', weight: 100}) I'm unable to find the Java equi...
Folkway asked 22/6, 2014 at 17:3

3

Solved

I'm trying to use MongoDB's Java driver to make two updates ($set and $push) to a record in the same operation. I'm using code similar to the following: BasicDBObject pushUpdate = new BasicDBObje...
Impetuous asked 30/1, 2012 at 21:41

3

Solved

I have the following document in mongo: > { "_id": ObjectId("569afce4b932c542500143ec"), > "date": "2016-1-17T2:31:0Z", > "day": NumberInt(17), > "model1": { > "date": "2016-01-1...
Argentiferous asked 26/1, 2016 at 10:24

3

Solved

What is the difference between the cursor.count() and cursor.size() methods of MongoDB's DBCursor?
Omnipresent asked 9/8, 2012 at 10:25

5

I Have a list of updated objects/documents i need save all the objects in the list at once. I saw save() in MongoTemplate but it can take single document at a time. Is there any way to save multi...

4

Solved

I followed this mongodb documentation. Here is my code public class JMongoDBCDemo { MongoClient mongoClient; DB db; DBCollection coll; public JMongoDBCDemo() { MongoClient mongoClient = new ...
Spanishamerican asked 5/4, 2015 at 6:54

1

I am bulk writing to MongoDB and get an OOM exception (java.lang.OutOfMemoryError: GC overhead limit exceeded). I have two questions: Does the OOM come from the Mongo Client Driver or MongoDB Ser...

8

Solved

I have a MongoDB whom store the date objects in UTC. Well, I want to perform aggregation by year,month day in a different timezone (CET). doing this, works fine for UTC: BasicDBObject group_id =...
Archivist asked 17/9, 2013 at 14:4

3

Solved

How to change the mongo connection pool size? I have seen it is 100 by default. Is there a way to change this value? I dont want to do it via spring, is there a way to configure it via MongoClien...
Rhinology asked 3/7, 2014 at 15:28

4

Solved

Collection:progs { "_id" : "ABC", "defaultDirectory" : "abc", "defaultRecvDirectory" : "abc" } { "_id" : "RAS", "defaultRecvDirectory" : "recv/ras" } { "_id" : "SND", "defaultSendDirectory" : "sen...
Chlorophyll asked 21/12, 2012 at 16:50

2

Solved

I want to see what queries mongo java driver produce, but I'm not able to do that. Using information from the official documentation I'm able just see in the log that update operation executes, bu...
Ashworth asked 18/1, 2018 at 16:43

5

We are reading from a local MongoDB all documents from a collections and performance is not very brillant. We need to dump all the data, don't be concerned why, just trust it's really needed and t...
Philip asked 30/8, 2018 at 16:9

5

Solved

I'm using mongo 2.2.3 and the java driver. My dilemma, I have to $push a field and value into an array, but I cant seem to figure out how to do this. A sample of my data: "_id" : 1, "scores" : [ ...
Eaglet asked 15/3, 2013 at 15:44

3

Solved

I want to execute soem admin command with parameters from java. The commands are: { enablesharding : "test" } { shardcollection : "test.test_collection", key : {"number":1} } How can I do it f...
Deaf asked 1/5, 2012 at 7:40

2

Solved

I've found in mongodb tutorial for java about how to query from mongo collection but the eq which they use doesn't work for me! Do you know how to filter documents from a collection with mongo and ...
Litchfield asked 23/9, 2017 at 19:5

4

Solved

I'm very new to MongoDB, and I'm using it along with the Java driver. I have this document structure: { "_id" : ObjectId("4f7d2ba6fd5a306d82687d48"), "room" : "Den" } { "_id" : ObjectId("4f7d2baaf...
Afterbody asked 27/4, 2012 at 6:27

5

Solved

I was wondering if there is a way to execute mongo like query directly through Java i.e. we give mongoDB like query as a String to a function in Java driver for mongoDB as a String Object and an DB...
Shanahan asked 1/2, 2011 at 9:12

8

Solved

When I insert a List into mongodb, there is a problem: Exception in thread "main" java.lang.IllegalArgumentException: can't serialize class mongodb.Person at org.bson.BasicBSONEncoder._putObjectF...
Brittneybrittni asked 5/1, 2012 at 6:17

6

Solved

References: http://www.mongodb.org/display/DOCS/Java+Tutorial Still pretty new to mongo db but I'm trying to update part of an existing document inside a collection... unfortunately, the link a...
Xavler asked 27/8, 2010 at 0:25

2

Solved

I am writing an algorithm that will go thru all available Mongo databases in java. On the windows shell I just do show dbs How can I do that in java and get back a list of all the available da...
Succor asked 14/3, 2013 at 17:47

2

Solved

I have a mongo query to be executed : query = { "dateField" : { "$gte" : ISODate('2011-11-10T07:45:32.962Z') } } When I do a db.Collection.find(query) on the mongo shell, I am able to retrieve t...
Inspectorate asked 1/2, 2012 at 5:18

1

Solved

What is the difference in $geoWithin and $geoIntersects operators in mongoDB? If I am looking for coordinates (using default coordinate reference system), $geoWithin and $geoIntersects will retur...
Frink asked 28/4, 2015 at 19:55

2

I am trying to write a lot of data to MongoDB, in a Java loop. I am getting errors based on the number of connections open. My theory is that since MongoDB is not transactional, lots of connection...
Aegrotat asked 25/10, 2011 at 14:39

2

Solved

After reading the mongo documentation that says each instance of a MongoClient handles its own pooling, how would I go about only having one instance across my whole application? This seems like i...
Afroasian asked 28/9, 2014 at 12:44

3

Solved

We are using morphia 0.99 and java driver 2.7.3 I would like to learn is there any difference between fetching records one by one using fetch and retrieving results by asList (assume that there is ...
Firooc asked 27/12, 2012 at 22:44

© 2022 - 2024 — McMap. All rights reserved.