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

  • Home
  • SEARCH
  • 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 7828729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:27:47+00:00 2026-06-02T10:27:47+00:00

I usually manipulate object by creating them unique codes. (So I create an object

  • 0

I usually manipulate object by creating them unique “codes”. (So I create an object with the code “test” and fetch the object back using objects.find({ code: "test" }). But I find this weird and counter-productive.

I’d like to know if it’s possible to simply create a new object, and get its saved object or simply its ObjectId back once saved?

That would be nice if we could do this:
objects.save({ name: “Test Object” });

And get { ObjectId: "47cc67093475061e3d95369d", name: "Test Object" } in return.

Is there any way to do so?

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-02T10:27:51+00:00Added an answer on June 2, 2026 at 10:27 am

    Is this what you’re looking for?

    > var record = {hello:"goodbye"};
    > db.test.save(record);
    > record;
    { "hello" : "goodbye", "_id" : ObjectId("4f90c9106aee6e21b4e55c65") }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Usually when we push viewcontroller, we will create object for view controller, after that
I usually open code.h and code.cpp at the same time. And display them side
usually i simply develop executable (.exe) files of my MATLAB codes by using this
Usually i'm using cherokee. Due to some critical issues with the latest chrome release
Usually when I'm creating indexes on tables, I generally guess what the Fill Factor
Usually Flash and Flex applications are embedded on in HTML using either a combination
Usually, parameter values are copied when being passed on. Using a reference may save
I'm using a wonderful plugin computedstyle.js that gets the computed style of objects. It
Whenever I do a curl call using the below code: NSURL *url = [NSURL
Usually there are lib, bin and spec(or test) folders in the ruby project(at least,

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.