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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:29:08+00:00 2026-05-25T03:29:08+00:00

In Mongodb, is their a way to add an extra attribute to documents (–TSV,

  • 0

In Mongodb, is their a way to add an extra attribute to documents (–TSV, –headerline) created with mongoimport?

I don’t have control of the data being imported, however I need to be able to distinguish one import data set from another, and their are no attributes in the file to distinguishing one import from another.

  • 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-05-25T03:29:08+00:00Added an answer on May 25, 2026 at 3:29 am

    I think your best option would be to write your own script to parse the csv/tsv and import it into mongodb. I think it would take under 10 lines of python.

    Alternatively if nothing else is inserting into the collection, and your import runs are far enough apart, you could just do something like this between runs:

    db.collecton.update({extraField:null}, {$set:{extraField: ObjectId()}}, false, true)
    

    This would work best with an index on {extraField:1}.

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

Sidebar

Related Questions

I'm just learning MongoDB and MongoMapper. This is on Rails 3. I created a
I have launch mongodb server: [demas@arch.local.net][~]% mongod --dbpatmongod --dbpath /home/demas/temp/ Mon Apr 19 09:44:18
with MongoDB (and I assume other NoSQL database APIs worth their salt) the ways
would grails work with mongodb or cassandra? or would you simply be using their
Simple question, do arrays keep their order when stored in MongoDB?
I am new to MongoDb but have an existing application which would benefit heavily
The MongoDB docs seem good overall, the only issue I have is that it
I currently have node.js, express, and mongodb in my heroku environment. What I want
Let us say we have a key with values which are polymorphic in their
I have a template which allows the user to edit their user information. <form

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.