<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:36:13 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>[CSHARP-234] Make the collection name accessible in IIdGenerator</title>
                <link>https://jira.mongodb.org/browse/CSHARP-234</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;Would be useful to also have the collection name accessible in IIdGenerator.&lt;br/&gt;
Creating a Hilo or sequence generator (as per: &lt;a href=&quot;http://www.mongodb.org/display/DOCS/Object+IDs&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://www.mongodb.org/display/DOCS/Object+IDs&lt;/a&gt;) is not possible without the collection name.&lt;/p&gt;</description>
                <environment></environment>
        <key id="17667">CSHARP-234</key>
            <summary>Make the collection name accessible in IIdGenerator</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</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="robert@mongodb.com">Robert Stam</assignee>
                                    <reporter username="zulkamal">Ahmed Zulkamal</reporter>
                        <labels>
                            <label>insert</label>
                    </labels>
                <created>Mon, 30 May 2011 16:47:28 +0000</created>
                <updated>Thu, 2 Apr 2015 18:28:20 +0000</updated>
                            <resolved>Thu, 2 Jun 2011 18:40:50 +0000</resolved>
                                    <version>1.0</version>
                                    <fixVersion>1.1</fixVersion>
                                    <component>Feature Request</component>
                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="36383" author="zulkamal" created="Mon, 6 Jun 2011 16:07:58 +0000"  >&lt;p&gt;The secondary Id is generally meant for use in URLs. Keeping the ObjectId around is quite useful since it has the create date bundled together but as an URL-facing Id, it&apos;s just ugly.&lt;br/&gt;
I don&apos;t suppose an IValueGenerator attribute would have that much use to justify adding it as a feature.&lt;/p&gt;</comment>
                            <comment id="36380" author="rstam" created="Mon, 6 Jun 2011 15:55:52 +0000"  >&lt;p&gt;Not sure why you would need a secondary Id if ObjectId is already unique.&lt;/p&gt;

&lt;p&gt;The serializer doesn&apos;t sound like the right place to do it. And a custom IIdGenerator won&apos;t work either since it&apos;s only invoked on the primary Id.&lt;/p&gt;

&lt;p&gt;So sounds like you need to handle it some layer of your own code.&lt;/p&gt;</comment>
                            <comment id="36377" author="zulkamal" created="Mon, 6 Jun 2011 15:41:15 +0000"  >&lt;p&gt;What would be your recommendation for populating a document that a ObjectId as the primary Id and a secondary HiLo Id?&lt;/p&gt;

&lt;p&gt;Would creating a custom serializer be useful or should the app&apos;s repository/service layer handle the assigning?&lt;/p&gt;</comment>
                            <comment id="35791" author="rstam" created="Thu, 2 Jun 2011 18:40:50 +0000"  >&lt;p&gt;This was a great suggestion. Thanks.&lt;/p&gt;

&lt;p&gt;Because IIdGenerator is in the BSON layer the implementation I chose is a little more abstract than you might have expected. GenerateId is now defined as:&lt;/p&gt;

&lt;p&gt;object GenerateId(object container, object document);&lt;/p&gt;

&lt;p&gt;but when called from the C# driver the value of container will always be an instance of MongoCollection. Once you cast the value to a MongoCollection you can get the name of the collection, as well as anything else you need to know about the collection.&lt;/p&gt;

&lt;p&gt;This is a backward breaking change, but only for the &lt;b&gt;very&lt;/b&gt; few users who might have implemented an IIdGenerator. The fix for them is trivial.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10011"><![CDATA[Minor Change]]></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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrh8wn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>14242</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>