Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8382363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:54:50+00:00 2026-06-09T16:54:50+00:00

Using mongo-2.8.0.jar, I want to get db-reference to an another db. But code (Groovy)

  • 0

Using mongo-2.8.0.jar, I want to get db-reference to an another db. But code (Groovy)

def ref = new DBRef(db,"mails",id)
println ref

Prints something like:

{ "$ref" : "mails", "$id" : "50211d8e44ae1f34b4f4b3bd" }

And no $db stored in database too!

How to force Java Mongo driver to save $db ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T16:54:52+00:00Added an answer on June 9, 2026 at 4:54 pm

    The Java driver does not support the optional $db field, as described in the MongoDB documentation. Not all drivers support the $db field. The Java driver assumes that the collection is in the same database as the document that is storing the reference.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using mongo-ruby-driver, I want to get stats/query graphs to show for Mongo.
I am using C# Mongo DB Driver for database operation. I want to get
I am using the Mongo Ruby driver and have this block of Ruby code
I have been using mysql in a new rails application, but now I wanted
So I'm mapreducing using mongo, and sometimes, but not always, the first element of
I found a gazillion answers for my issue if I was using Mongo, but
I'm new in mongodb and can't find the solution. I'm using mongo-php-driver I just
I want to know how many ways we can get Server Database using JavaScript
I'm using the Mongo LINQ Driver for C#, works great. Sorting a lot of
I am using PHP/Mongo to query a data set like the following: { description:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.