<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:35:42 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-64] Add strongly typed CreateIndex() methods</title>
                <link>https://jira.mongodb.org/browse/CSHARP-64</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;The current way of creating indexes using string arguments is neither intuitive nor provides it compile time checking. It would be good to be able to create indexes in a strongly typed fashion. &lt;/p&gt;

&lt;p&gt;var col = db.GetCollection&amp;lt;User&amp;gt;();&lt;br/&gt;
var meta = col.Metadata;&lt;br/&gt;
col.CreateIndex(x =&amp;gt; x.Username, &quot;idx_username&quot;, true, IndexOption.Ascending);&lt;/p&gt;</description>
                <environment></environment>
        <key id="13084">CSHARP-64</key>
            <summary>Add strongly typed CreateIndex() methods</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="3">Duplicate</resolution>
                                        <assignee username="sam">Sam Corder</assignee>
                                    <reporter username="oliverw">Oliver Weichhold</reporter>
                        <labels>
                    </labels>
                <created>Tue, 14 Sep 2010 07:35:40 +0000</created>
                <updated>Wed, 19 Oct 2016 22:39:56 +0000</updated>
                            <resolved>Wed, 20 Oct 2010 13:24:01 +0000</resolved>
                                                                    <component>SAMUS</component>
                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="19388" author="lanwin" created="Wed, 20 Oct 2010 13:24:01 +0000"  >&lt;p&gt;Migrated to GitHub &lt;a href=&quot;http://github.com/mongodb-csharp/mongodb-csharp/issues/issue/9&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb-csharp/mongodb-csharp/issues/issue/9&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="18151" author="oliverw" created="Tue, 14 Sep 2010 15:15:34 +0000"  >&lt;p&gt;I took the liberty and implemented it myself against the latest HEAD. Perhaps its of some use. &lt;/p&gt;

&lt;p&gt;Usage:&lt;/p&gt;

&lt;p&gt;public class User&lt;br/&gt;
{&lt;br/&gt;
  public Guid Id &lt;/p&gt;
{ get; set; }&lt;br/&gt;
  public string Username { get; set; }
&lt;p&gt;  public string Password &lt;/p&gt;
{ get; set; }
&lt;p&gt;}&lt;/p&gt;


&lt;p&gt;var col = db.GetCollection&amp;lt;User&amp;gt;(); &lt;/p&gt;

&lt;p&gt;// Single Column Index&lt;br/&gt;
col.CreateIndex(x =&amp;gt; x.Username, &quot;idx_username&quot;, true, IndexDirection.Ascending);&lt;/p&gt;

&lt;p&gt;// Composite Index&lt;br/&gt;
col.CreateIndex(x =&amp;gt; new &lt;/p&gt;
{x.Username, x.Password }
&lt;p&gt;, &quot;idx_username_password&quot;, true, IndexDirection.Ascending);&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="10445" name="0001-CreateIndex.patch" size="5087" author="oliverw" created="Tue, 14 Sep 2010 15:15:34 +0000"/>
                            <attachment id="10446" name="0002-CreateIndex.patch" size="946" author="oliverw" created="Tue, 14 Sep 2010 15:15:34 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <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|hrh9wn:</customfieldvalue>

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