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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:45:31+00:00 2026-06-12T08:45:31+00:00

When you insert a single document or set of documents to a MongoDB instance

  • 0

When you insert a single document or set of documents to a MongoDB instance using Pymongo via IDLE, the ObjectIDs of all the successfully inserted documents are echoed to the standard output.

>>> new_posts = [{"author": "Mike",
...               "text": "Another post!",   
...               "tags": ["bulk", "insert"],
...               "date": datetime.datetime(2009, 11, 12, 11, 14)},
...              {"author": "Eliot",
...               "title": "MongoDB is fun",
...               "text": "and pretty easy too!",
...               "date": datetime.datetime(2009, 11, 10, 10, 45)}]
>>> posts.insert(new_posts)
[ObjectId('...'), ObjectId('...')]

Is there an option I can run to stop these ObjectIDs from being displayed? The problem is that IDLE gets buggy when it has to render large bits of text (say, tens of thousands of added objectids).

FWIW, I’m using Python 2.7 and the most recent version of PyMongo. Happy to provide more details if necessary.

Thanks,

Ben

  • 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-12T08:45:32+00:00Added an answer on June 12, 2026 at 8:45 am

    You can assign the result to a variable and then it won’t be echoed.

    >>> echo=d.echo
    >>> echo.insert({"new":"test"})
    ObjectId('50647520594bc0f223000000')
    >>> new=echo.insert({"new":"test"})
    >>> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to do a single row insert/update on a table but all the
How can i insert multiple values in a sql table using single statement. Doing
I'm using Codeigniter to insert some data into a MySQL table. However, the single
I'd like to insert a picture (figure) into a document which is using a
I am using spring BatchSqlUpdate to insert a set of rows. How do I
I wanted to know if a single document fragment can be used to insert
I am using XDocument in LINQ to edit (insert) and save xml document. XDocument
I am adding batches of records to a table using a single insert statement.
I tried to create a single insert query for the values in template_list array.
How can I do one single query with both an INSERT and SELECT in

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.