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?
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/15bea4f0-fbc5-4d52-91f0-3e6d500891a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.