[SERVER-1186] mongoimport: add ability to choose key for upsert instead of just _id Created: 02/Jun/10  Updated: 12/Jul/16  Resolved: 14/Jun/10

Status: Closed
Project: Core Server
Component/s: Tools
Affects Version/s: None
Fix Version/s: 1.5.3

Type: Improvement Priority: Trivial - P5
Reporter: Brandon Martin Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

The upsert is a great feature but I would like to ability to choose a key instead of just assuming _id as the key.

Should be able to choose a list of fields



 Comments   
Comment by auto [ 14/Jun/10 ]

Author:

{'login': 'RedBeard0531', 'name': 'Mathias Stearn', 'email': 'redbeard0531@gmail.com'}

Message: Allow specifying upsert fields for mongoimport SERVER-1186
http://github.com/mongodb/mongo/commit/efbbcc80beb24896387daecd64a8535f26fc0665

Comment by Brandon Martin [ 03/Jun/10 ]

Sorry I just realized I did not specify mongoimport.

Comment by Scott Hernandez (Inactive) [ 03/Jun/10 ]

Got it. You want to be able to specify the query part of the update for the upsert during the import. Makes perfect sense. I just couldn't tell this was for mongoimport.

It would be good if it was a list of field names, not just one.

Comment by Brandon Martin [ 03/Jun/10 ]

I will be imported a tsv file daily and the tsv file has a field that I am using a key since the tsv will not have the _id when I recieve it. So I thought it would be good if you could pass a field name after --upsert as the key.

--upsert uniquecolumn

Comment by Scott Hernandez (Inactive) [ 03/Jun/10 ]

But _id is the key, what do you mean? What is the use case?

Generated at Thu Feb 08 02:56:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.