top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Mongodb: Asynchronous java mapper (morphia like)

0 votes
445 views

I have been using morphia (object-storage mapper based on mongo java driver) for quite a while and I am satisfied with it but I would welcome also asynchronous version. I think it seem pretty straightforward as there is already asynchronous java driver. Do you know if something is planned or maybe if there is another option besides morphia?

posted Jul 22, 2015 by anonymous

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
0 votes

My collection is like this, but I want to update a nested object with {"env":"qa"} in my updated collection with java-driver:

{ "_id" : ObjectId("5b052eeff9290437b217b1ed"), "app" : "hike", "group" : [ { "env" : "prod" }, { "env" : "test" } ]}{ "_id" : ObjectId("5b052f36f9290437b217b1ee"), "app" : "viber", "group" : [ { "env" : "prod" }, { "env" : "test" } ]}

+1 vote

I have a Created a Mongo Document inserted successfully to the Collection ~ "urldetls" which has 12 specific Unique keys with data in the values.

Spec: Mongodb 3.x, Java 1.7,

Question: I would like to retrieve the full document based on the value searched within all of the documents.
Problem: I cannot retrieve the document based on the key of the document.

How can i retrieve? I would like to use the Mongodb API 3.x version using java .

0 votes

db.Job.insert({"job_Title" : "Website", "job_Location" : "Kolkata", "salary" : "40000", "company" : "ROHIT", "department" : { "$ref": "department", "$id": ObjectId("579302282d180c1b80be65ec"), "$db": "test"}, "status":"Act"})
var job = db.Job.findOne({"company":"LOKI"})
var dep = job.department db[dep.$ref].findOne({"_id":(dep.$id)})

How we write this mongoDB shell query in Java program for insert and find Document?

+1 vote

With the non-blocking asynchronous mongo java/scala driver, it is possible to define a wait time and a wait queue size for operations that cannot be executed directly with a free connection. When settings these values, the mongo driver will make the threads waiting for an available connection.

This behavior is very dangerous for an application written with non-blocking asynchronous IO in mind. These applications use a very limited number of threads (= numbers of cores). Blocking one of these thread can block the whole application.

What would be the recommended way to for this kind of applications? Should we set all these waiting settings to 0 and handle MongoWaitQueueFullException with retries in the application? Should the driver call an application callback when a connection is free?

...