<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:37:55 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-819] DOCS: Case insensative string serialization in .NET driver</title>
                <link>https://jira.mongodb.org/browse/CSHARP-819</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;I would like an attribute which controls string serialization to / from Mongo at the C# layer. Something like &lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;BsonStringOptions(UseLowerCase = true)&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;The motivation: Here&apos;s some feedback from a new app I&apos;m working on in C#.&lt;/p&gt;

&lt;p&gt;We are coming from SQL Server where most string comparisons are case &lt;b&gt;insensitive&lt;/b&gt;. Obviously MongoDB is case sensitive.&lt;/p&gt;

&lt;p&gt;There are plenty of fields we want to continue case insensitive comps on. For example, usernames, emails, urls, etc. We are fine to just store them all lowercase. But having the serialization engine help ensure this would help.&lt;/p&gt;

&lt;p&gt;It would be great if there was an attribute that would help with this (kind of like &lt;span class=&quot;error&quot;&gt;&amp;#91;BsonDateTimeOptions(Kind = DateTimeKind.Local)&amp;#93;&lt;/span&gt; for UTC vs Local time).&lt;/p&gt;

&lt;p&gt;So I&apos;d like to offer a new feature idea:&lt;/p&gt;

&lt;p&gt;class Model {&lt;br/&gt;
   &lt;span class=&quot;error&quot;&gt;&amp;#91;BsonStringOptions(UseLowerCase = true)&amp;#93;&lt;/span&gt;&lt;br/&gt;
   public string Username &lt;/p&gt;
{get; set;}
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;Where when this object is saved, it automatically converts to lowercase. I can do this in code, but it&apos;s a pain and potentially error prone.&lt;/p&gt;</description>
                <environment>C# Driver </environment>
        <key id="89378">CSHARP-819</key>
            <summary>DOCS: Case insensative string serialization in .NET driver</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="-1">Unassigned</assignee>
                                    <reporter username="mkennedy66996693">Michael Kennedy</reporter>
                        <labels>
                    </labels>
                <created>Wed, 11 Sep 2013 15:44:05 +0000</created>
                <updated>Fri, 2 Feb 2018 15:38:07 +0000</updated>
                            <resolved>Fri, 2 Feb 2018 15:38:07 +0000</resolved>
                                    <version>1.8.2</version>
                                                    <component>Serialization</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="426072" author="mkennedy66996693" created="Mon, 16 Sep 2013 15:58:22 +0000"  >&lt;p&gt;Thanks Craig. That&apos;s good to know. I&apos;ll see what I can whip up. It&apos;d be nice to see it part of the official driver eventually.&lt;/p&gt;

&lt;p&gt;Cheers,&lt;br/&gt;
Michael&lt;/p&gt;</comment>
                            <comment id="422722" author="craiggwilson" created="Wed, 11 Sep 2013 16:41:33 +0000"  >&lt;p&gt;Hi Michael,&lt;br/&gt;
  Good suggestion.  For now, it would be relatively straightforward to create a custom string serializer to do just this.  You can use the existing string serializer as a template: &lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/blob/master/MongoDB.Bson/Serialization/Serializers/StringSerializer.cs&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/blob/master/MongoDB.Bson/Serialization/Serializers/StringSerializer.cs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;  You obviously don&apos;t want this serializer used for all strings.  For this, you can create an attribute yourself by inheriting from Attribute and implementing IBsonMemberMapAttribute.  You can then switch the serializer for this custom string one out inside the Apply method of the attribute.&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="10038"><![CDATA[Fully Compatible]]></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|hs0tef:</customfieldvalue>

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