mongo-java-driver Questions
6
Solved
I have a device collection.
{
"_id" : "10-100-5675234",
"_type" : "Device",
"alias" : "new Alias name",
"claimCode" : "FG755DF8N",
"hardwareId" : "SERAIL02",
"isClaimed" : "true",
"model"...
Kahaleel asked 1/4, 2015 at 11:37
5
Solved
If I try to put a date field in a Document (BSON) and write it to Mongo, BSON writes it in UTC. For example, a date
DateTime dateTime = new DateTime("2015-07-01");
Document doc = new Document("da...
Sissel asked 27/7, 2015 at 13:35
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
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...
Cagliostro asked 6/6, 2018 at 11:7
3
Solved
I want to change the default size of connection pool provided by java mongodb driver which is 100 according to mongo docs.
Below is the mongo client bean which I used to customize the connection p...
Triangulate asked 7/11, 2017 at 15:2
4
How to fire mongo native queries using java-mongo-driver only.
No Spring-Data or EclipseLink or Hibernate OGM, Only using java-mongo-driver
Sample query :
db.orders.aggregate([
{
$unwind: "...
Bolognese asked 3/11, 2017 at 10:30
2
Solved
I'm trying to perform an aggregation operation using in Java using the mongo-java-driver. I've performed some other find operations, but I'm unable to do the following aggregation correctly in Java...
Hardunn asked 5/7, 2016 at 11:58
3
Solved
I have a simple snippet as below. I referred this
List<Document> list = new LinkedList<Document>();
FindIterable<Document> itr = collection.find(findQuery)
.forEach((Document do...
Louralourdes asked 22/4, 2020 at 7:46
1
Solved
I am using this dependency.
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver</artifactId>
<version>3.12.2</version>
</depend...
Heaton asked 6/4, 2020 at 3:15
2
I am using MongoDB v3.2.0 with Mongo Java Driver 3.0.4 version. I am using the BasicDBObject (deprecated) instead of using the Document in java, as I need to do many changes for converting to Docum...
Curve asked 3/7, 2017 at 5: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...
Vannesavanness asked 15/11, 2016 at 9:39
2
Solved
I am running on Mongodb 3.6, with mongo driver 3.4.3 and spring data mongo 1.5.10. Below is the structure of my document
{
"_id": 12345,
"_class": "com.example.ProductRates",
"rates": [
{
"pr...
Oversweet asked 18/4, 2018 at 18:5
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
1
I am using MongoDB's Java Async Driver version 3.6, I don't see a findAndModify implemented as part of MongoCollection Class (am I mistaken?), the closest thing is findOneAndUpdate can someon...
Quadrifid asked 17/5, 2018 at 13:58
3
I am using MongoOptions class and its methods
setFsync(boolean sync)
setJ(boolean safe)
setW(int val)
setWtimeout(int timeoutMS)
setSafe(boolean isSafe)
How to achieve this using MongoClient...
Blether asked 31/3, 2015 at 9:39
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
1
Solved
I was trying to look for an example or usage of the ClusterListener to optimize and improve the debugging information of a service integrated with MongoDB Java client.
How could this be used by us...
Lewendal asked 10/7, 2017 at 17:23
1
Solved
So I have a mongo document like this and I need to update the array based on the val
{
"_id" : NumberLong(222),
"pattern":"grain"
"BASIC" : {
"frame...
Elver asked 13/12, 2016 at 1:31
2
Solved
I'm trying to Or some conditions in MongoDB (using the Java driver). This is what I'm doing :
Pattern regex = Pattern.compile("title");
DBCollection coll = MongoDBUtil.getDB().getCollection("pos...
Orabelle asked 16/5, 2012 at 14:31
3
Solved
In the earlier versions of MongoDB Java drivers , to run a query and do unordered bulk upsert on the result all we had do was :
BulkWriteOperation bulk = dbCollection.initializeUnorderedBulkOperat...
Orthohydrogen asked 17/7, 2015 at 7:38
1
Solved
Is there any possibility in MongoDB java driver to make backUp and restore DB?
My solution (just execute command) for now:
public void makeBackUp(String path) {
try {
Runtime.getRuntime().exec...
Thuthucydides asked 19/7, 2016 at 11:22
1
Solved
I want to execute query in MongoDB 3.2 with Java Driver 3.2, which contains both $and and $or clauses at the same time.
With the reference, I tried the following approach:
List<Document> crit...
Normi asked 20/4, 2016 at 19:22
1
Solved
MongoIterable.forEach requires a Block which is very similar to Java 8 Consumer.
They are similar enough to cause problems, for example, the following doesn't compile:
MongoIterable<Document>...
Bosworth asked 7/1, 2016 at 21:9
1
Following is the aggregation query :
[
{
"$match": {
"UserId": {
"$in": [
5
]
},
"WorkflowStartTime": {
"$gte": ISODate('2015-04-09T00:00:00.000Z'),
"$lte": ISODate('2015-04-16T00:00:00...
Monzon asked 15/4, 2015 at 6:3
1
© 2022 - 2024 — McMap. All rights reserved.