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 9225357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:33:24+00:00 2026-06-18T04:33:24+00:00

The MongoDB Java driver documentation of the packet org.bson mentions various Lazy versions of

  • 0

The MongoDB Java driver documentation of the packet org.bson mentions various “Lazy” versions of other classes. Unfortunately the Javadocs of these classes can barely be called documentation.

What is their purpose and how does their behavior differ from the normal versions?

  • 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-18T04:33:25+00:00Added an answer on June 18, 2026 at 4:33 am

    Under normal operation, the driver creates and consumes documents using the DBObject Map-like interface. When inserting documents, it iterates over the map to convert it the corresponding BSON representation. When querying, it creates new documents by putting key-value pairs into the map.

    But there are times when you want to work with raw BSON and not pay the cost of all this serialization and deserialization. That’s what the lazy DBObject implementations are for. Instead of treating them as a map, a custom encoder instead writes the bytes directly to the BSON stream. Similarly, a custom decoder writes the raw bytes directly into the lazy DBObject.

    In this context, the meaning of the term lazy is that, since the lazy equivalents still have to implement the DBObject interface, they do so by “lazily” interpreting the raw BSON byte array that they contain.

    One last note: the lazy DBObject classes are very likely not going to be included in the upcoming 3.0 release of the driver, as the entire serialization is changing in a way that is not compatibile with lazy DBObjects. There will be equivalent functionality, but not API compatible.

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

Sidebar

Related Questions

I am using the java MongoDB driver for gridfs and would like to use
I'm using MongoDB 2.2 with java-driver 2.10.1 I'm inserting a date field into a
We are inserting documents in mongo through spring-mongodb and the mongo-java-driver everything seems to
I am using Mongodb Java driver for my Java client application. it needs to
Casbah is another layer on top of Java driver for MongoDb. Would this reduce
I need to know how to use where in MongoDB queries using Java Driver.
How does setting the WriteConcern flag to SAFE in the java driver affects MongoDB
I'm using the MongoDB Java driver, and can't seem to get a query to
I have more than 20M data in MongoDB and by using java driver I
Im using the MongoDB Java driver in a java web app. One question I

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.