top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

Mongodb retrieve data with API 3.x using Java

+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 .

posted May 29, 2017 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" } ]}

0 votes

I have recently downloaded MongoDB 3.4 tarball and installed on a three node replica set. I do not find mongod init scripts with this distribution.
Has anyone encountered the same issue?I am running 3.4 on RHEL 7

+1 vote

I recently upgraded the latest PHP driver and could do an "explain" query by using the "$explain" modifier when executing the query, however as of MongoDB 3.2 the operator was removed so this is no longer possible.

So my question is how can I do an explain query with the new driver and MongoDB 3.2?

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?

Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.