<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:53:21 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-195] AutoIncrement IDs</title>
                <link>https://jira.mongodb.org/browse/SERVER-195</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;I&apos;d like to have an autoincrement  functionality that automatically assings sequencial integers as the &quot;_id&quot; when inserting new documents in a collection. This is the only thing stopping me from completely moving away of myql to mongodb.&lt;/p&gt;</description>
                <environment></environment>
        <key id="10372">SERVER-195</key>
            <summary>AutoIncrement IDs</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="eliot">Eliot Horowitz</assignee>
                                    <reporter username="diegomsana">Diego Sana</reporter>
                        <labels>
                    </labels>
                <created>Wed, 29 Jul 2009 07:41:29 +0000</created>
                <updated>Tue, 20 Dec 2022 22:10:46 +0000</updated>
                            <resolved>Sat, 17 Oct 2009 10:18:54 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>7</watches>
                                                                                                                <comments>
                            <comment id="42666" author="wardrop" created="Sat, 16 Jul 2011 23:57:56 +0000"  >&lt;p&gt;This definitely needs to be looked at again. While not always a requirement, sometimes have an incremental, or otherwise short and human friendly index is a requirement. There are ways to implement Auto-Increment manually, by given how common the requirement is, wouldn&apos;t it make sense to build this into MongoDB. Who care&apos;s if it&apos;s slow, as often custom solutions are pretty damn slow too; but it doesn&apos;t matter that much if your collection is read-heavy (such as for a blog, orders on an online shop, products, etc). Also, not everyone uses sharding. Believe it or not, some people use Mongo not because of its performance, but simply because it&apos;s document orientated. I do wish tickets like these weren&apos;t dismissed without proper reasoning or a fair debate.&lt;/p&gt;</comment>
                            <comment id="22580" author="shimondoodkin" created="Fri, 21 Jan 2011 15:55:10 +0000"  >&lt;p&gt;it looks like that  Auto Increment id could be a type of active index&lt;/p&gt;</comment>
                            <comment id="19177" author="paul.okopny" created="Thu, 14 Oct 2010 14:49:59 +0000"  >&lt;p&gt;To Eliot:&lt;br/&gt;
Autoincrement field is really needed to sort the documents easily and to get a human-friendly IDs. Sometimes it can a very important feature. DB-users should decide by themselfs if they do need autoincrement and if they can afford the whole system to be very slow. Thought I do really doubt it would that much affect the speed. I guess there are ways to solve the speed problems.&lt;/p&gt;</comment>
                            <comment id="13292" author="scotthernandez" created="Tue, 30 Mar 2010 16:48:58 +0000"  >&lt;p&gt;Size matters, but sharding is more important. I&apos;d like auto-incrementing numbers too but not at the cost of sharding.&lt;/p&gt;

&lt;p&gt;Also, if size is the real issue it seems like some kinds of optimization with key-names is more important than the difference between 8/12 bytes. For example, if I am storing objects where I might have a millions (or billions) of documents with 15-40 key-value pairs of ints (32bit values) then the overhead of storing the key-name in each document becomes significant. For every key-value pair there may be 3-8 charaters (8-chars (8-bit) = 64bits) + 1 int (32bit)  which makes the key-name twice as big as the data. Anyway, you see where I&apos;m going...&lt;/p&gt;</comment>
                            <comment id="10333" author="eliot" created="Wed, 29 Jul 2009 21:18:50 +0000"  >&lt;p&gt;so, my general feelings:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;int auto increment is to small these days&lt;/li&gt;
	&lt;li&gt;long is 8 bytes&lt;/li&gt;
	&lt;li&gt;ObjectId is 12, so not too much bigger&lt;/li&gt;
	&lt;li&gt;with ObjectId you can get sharding, which is more beneficial&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;What are your thoughts on these?&lt;/p&gt;</comment>
                            <comment id="10332" author="diegomsana" created="Wed, 29 Jul 2009 21:15:45 +0000"  >&lt;p&gt;Eliot: faster lookups and, mainly, data size. Many of my collections contain millions of documents that store basicly a lot of _ids of others documents, so _id size matters a lot.&lt;/p&gt;</comment>
                            <comment id="10330" author="eliot" created="Wed, 29 Jul 2009 08:04:05 +0000"  >&lt;p&gt;the problem with auto increment ids is that it doesn&apos;t work in a sharded environment.  you would have to synchronize across machines, which would make it very slow.&lt;/p&gt;

&lt;p&gt;why do you need this rather that a guid (like ObjectId)?&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>7.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[5006R00001qEkA3QAK]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 29 Jul 2009 08:04:05 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        12 years, 31 weeks, 4 days 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>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            12 years, 31 weeks, 4 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>diegomsana</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>paul.okopny</customfieldvalue>
            <customfieldvalue>scotthernandez</customfieldvalue>
            <customfieldvalue>shimondoodkin</customfieldvalue>
            <customfieldvalue>wardrop</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrpx0n:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>23673</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|hszugv:</customfieldvalue>

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