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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:17:40+00:00 2026-06-15T13:17:40+00:00

My fetched DBObject looks like following { _id : { $oid : 50c28ac1de86acf0bdfbeca0} ,

  • 0

My fetched DBObject looks like following

{ "_id" : { "$oid" : "50c28ac1de86acf0bdfbeca0"} , 
"schedule" : { "startAt" : 1354926785198 , "endAt" : 1391155200000 , "repeatForever" : true , "interval" : 3600} , "destination" : "Storage-East"}

I want to extract JSON string sans “_id” so that I can deserialize it back to my Java object. If I use following I can remove the ‘_id’ field and it is fine to get the Java object back from JSON String. Is there any other elegant way of doing this ?

dbObj.removeField("_id");
String jsonString = dbObj.toString();

// Now readValue from the json string 

thanks.

  • 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-15T13:17:41+00:00Added an answer on June 15, 2026 at 1:17 pm

    Instead of removing the data afterwords, just use results projections. You simply remove the _id by using the result projections in a find statement:

    //find all documents where destination equals Storage-East, but exclude _id from result set
    db.inventory.find( { "destination": 'Storage-East' }, { _id:0 } )
    

    You can find the documentation http://docs.mongodb.org/manual/core/read-operations/#result-projections.

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

Sidebar

Related Questions

How to bookmark page or content fetched using AJAX? It looks like it can
my xml code fetched over network looks like this <?xml version='1.0' ?><liverequestresponse><liverequesttime>180</liverequesttime><livemessage></livemessage></liverequestresponse> and my
The script I used fetched a file from https://www.dropbox.com/browse_plain/ $REMOTEDIR?no_js=true which now returns: HTTP/1.1
i fetched from created field date and time like this format 2011-3-10 17:26:50 and
I have the following data fetched in the array using php and my sql
I would like to validate one string fetched as a response from a server.
I have fetched some data from a SQL database into a datagridview, but after
So I fetched some data from a mdb file in c# via SELECT *
I have fetched a result from core data in my app and need to
I have fetched images and text as listview from database.now on clicking the particular

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.