<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:58:52 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-2070] upsertFields not updating</title>
                <link>https://jira.mongodb.org/browse/SERVER-2070</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Hello, and thank-you in advance. &lt;br/&gt;
1) I&apos;m able to import a CSV file by using the following: &lt;br/&gt;
mongoimport &lt;del&gt;d test01 -c items --type csv --headerline item-file&lt;/del&gt; v1.csv &lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;this file has 20 fields listed on the csv header, two of which are&lt;br/&gt;
Item Number and Price. &lt;/li&gt;
	&lt;li&gt;the database &apos;test01&apos; has a collection &apos;items&apos; with an Index for&lt;br/&gt;
Item Number as the key field (no duplicates). &lt;/li&gt;
	&lt;li&gt;requirement is to update prices wholesale by importing a concise&lt;br/&gt;
file of only two fields Item Number and Price and leaving the &lt;br/&gt;
remaining 18 fields as is. &lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I then try the following: &lt;br/&gt;
mongoimport -d test01 -c items --type csv --upsertFields &quot;Item Number&quot; --headerline item-file-update-v1.csv &lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;with the index on Item Number I get the following:
	&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
		&lt;li&gt;
		&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
			&lt;li&gt;
			&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
				&lt;li&gt;
				&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
					&lt;li&gt;
					&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
						&lt;li&gt;
						&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
							&lt;li&gt;
							&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
								&lt;li&gt;
								&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
									&lt;li&gt;
									&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
										&lt;li&gt;
										&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
											&lt;li&gt;
											&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
												&lt;li&gt;
												&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
													&lt;li&gt;
													&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
														&lt;li&gt;
														&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
															&lt;li&gt;
															&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
																&lt;li&gt;
																&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
																	&lt;li&gt;
																	&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
																		&lt;li&gt;
																		&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
																			&lt;li&gt;&lt;p&gt;connected to: 127.0.0.1 &lt;br/&gt;
                430220/443150   97% &lt;br/&gt;
                        23600   7866/second &lt;br/&gt;
imported 24323 objects &lt;/p&gt;&lt;/li&gt;
																			&lt;li&gt;&lt;p&gt;-&amp;gt; no prices have been updated in the collection &lt;/p&gt;&lt;/li&gt;
																		&lt;/ul&gt;
																		&lt;/li&gt;
																	&lt;/ul&gt;
																	&lt;/li&gt;
																&lt;/ul&gt;
																&lt;/li&gt;
															&lt;/ul&gt;
															&lt;/li&gt;
														&lt;/ul&gt;
														&lt;/li&gt;
													&lt;/ul&gt;
													&lt;/li&gt;
												&lt;/ul&gt;
												&lt;/li&gt;
											&lt;/ul&gt;
											&lt;/li&gt;
										&lt;/ul&gt;
										&lt;/li&gt;
									&lt;/ul&gt;
									&lt;/li&gt;
								&lt;/ul&gt;
								&lt;/li&gt;
							&lt;/ul&gt;
							&lt;/li&gt;
						&lt;/ul&gt;
						&lt;/li&gt;
					&lt;/ul&gt;
					&lt;/li&gt;
				&lt;/ul&gt;
				&lt;/li&gt;
			&lt;/ul&gt;
			&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;with no index on the Item Number, I get the following:
	&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
		&lt;li&gt;
		&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
			&lt;li&gt;
			&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
				&lt;li&gt;
				&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
					&lt;li&gt;
					&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
						&lt;li&gt;
						&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
							&lt;li&gt;
							&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
								&lt;li&gt;
								&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
									&lt;li&gt;
									&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
										&lt;li&gt;
										&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
											&lt;li&gt;
											&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
												&lt;li&gt;
												&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
													&lt;li&gt;
													&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
														&lt;li&gt;
														&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
															&lt;li&gt;
															&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
																&lt;li&gt;
																&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
																	&lt;li&gt;
																	&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
																		&lt;li&gt;
																		&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
																			&lt;li&gt;&lt;p&gt;connected to: 127.0.0.1 &lt;br/&gt;
imported 24323 objects &lt;/p&gt;&lt;/li&gt;
																			&lt;li&gt;&lt;p&gt;-&amp;gt; the items from the csv were inserted as new items duplicating the &lt;br/&gt;
collection which is expected. &lt;/p&gt;&lt;/li&gt;
																		&lt;/ul&gt;
																		&lt;/li&gt;
																	&lt;/ul&gt;
																	&lt;/li&gt;
																&lt;/ul&gt;
																&lt;/li&gt;
															&lt;/ul&gt;
															&lt;/li&gt;
														&lt;/ul&gt;
														&lt;/li&gt;
													&lt;/ul&gt;
													&lt;/li&gt;
												&lt;/ul&gt;
												&lt;/li&gt;
											&lt;/ul&gt;
											&lt;/li&gt;
										&lt;/ul&gt;
										&lt;/li&gt;
									&lt;/ul&gt;
									&lt;/li&gt;
								&lt;/ul&gt;
								&lt;/li&gt;
							&lt;/ul&gt;
							&lt;/li&gt;
						&lt;/ul&gt;
						&lt;/li&gt;
					&lt;/ul&gt;
					&lt;/li&gt;
				&lt;/ul&gt;
				&lt;/li&gt;
			&lt;/ul&gt;
			&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;I also tried this:&lt;br/&gt;
mongoimport -d test01 -c items -f &quot;Item Number&quot;,Price --type csv --upsertFields &quot;Item Number&quot;,Price --headerline item-file-update-v1.csv &lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;-&amp;gt; same results of prices not being updated. &lt;br/&gt;
I&apos;m not able to update the prices in the collection by using the &lt;br/&gt;
second  update csv file. I searched for other upsertFields examples &lt;br/&gt;
but to no avail. Help on this would be very much appreciated. &lt;/p&gt;

&lt;p&gt;also, &lt;br/&gt;
2) would there be an RoR gem that leverages mongoimport for csv file uploads? &lt;/p&gt;</description>
                <environment>Linux ubuntu 2.6.32-25-generic #45-Ubuntu SMP Sat Oct 16 19:52:42 UTC 2010 x86_64 GNU/Linux&amp;quot;</environment>
        <key id="13642">SERVER-2070</key>
            <summary>upsertFields not updating</summary>
                <type id="6" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14720&amp;avatarType=issuetype">Question</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="mathias@mongodb.com">Mathias Stearn</assignee>
                                    <reporter username="snamikas">Simon Namikas</reporter>
                        <labels>
                    </labels>
                <created>Mon, 8 Nov 2010 06:31:05 +0000</created>
                <updated>Tue, 12 Jul 2016 00:20:37 +0000</updated>
                            <resolved>Wed, 1 Dec 2010 21:41:13 +0000</resolved>
                                    <version>1.6.4</version>
                                    <fixVersion>1.7.4</fixVersion>
                                    <component>Write Ops</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="20942" author="redbeard0531" created="Wed, 1 Dec 2010 21:45:35 +0000"  >&lt;p&gt;Oh, btw, upsert probably won&apos;t do what you want it to. It would replace the object with the matching Item Number with the lines specified (ie remove all fields other than Item Number and Price). You really want to run through all of them and do db.items.update(&lt;/p&gt;
{&quot;Item Number&quot;: num}
&lt;p&gt;, {$set:{Price: new_price}}). We don&apos;t have an automated tool to do that, but it should be easy to do with a few lines of ruby.&lt;/p&gt;</comment>
                            <comment id="20939" author="redbeard0531" created="Wed, 1 Dec 2010 21:41:13 +0000"  >&lt;p&gt;The issue was that --upsertFields didn&apos;t imply --upsert. If you added --upsert to your first update command it would work. I&apos;ve modified mongoimport to make --upsert implicit if you specify --upsertFields to hopefully prevent other people from getting confused.&lt;/p&gt;</comment>
                            <comment id="20937" author="auto" created="Wed, 1 Dec 2010 21:39:40 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;RedBeard0531&apos;, &apos;name&apos;: &apos;Mathias Stearn&apos;, &apos;email&apos;: &apos;mathias@10gen.com&apos;}
&lt;p&gt;Message: mongoimport: --upsertFields should imply --upsert &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-2070&quot; title=&quot;upsertFields not updating&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-2070&quot;&gt;&lt;del&gt;SERVER-2070&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
/mongodb/mongo/commit/53c8e5e3665e5650aaba28f45d5bd2c6fba96e4b&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="10589" name="item-file-update-v1.csv" size="443151" author="snamikas" created="Mon, 8 Nov 2010 06:31:05 +0000"/>
                            <attachment id="10588" name="item-file-v1.csv" size="5482520" author="snamikas" created="Mon, 8 Nov 2010 06:31:05 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 1 Dec 2010 21:39:40 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        13 years, 12 weeks ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>false</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            13 years, 12 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>auto</customfieldvalue>
            <customfieldvalue>mathias@mongodb.com</customfieldvalue>
            <customfieldvalue>snamikas</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrpbnz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrigyn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>21400</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hszyq7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>