<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:52:59 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-90] case insensitive index</title>
                <link>https://jira.mongodb.org/browse/SERVER-90</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;div class=&quot;panel&quot; style=&quot;background-color: #EEEEEE;border-color: #ccc;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-color: #ccc;background-color: #6CB33F;&quot;&gt;&lt;b&gt;Issue Status as of Aug 23, 2016&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;panelContent&quot; style=&quot;background-color: #EEEEEE;&quot;&gt;
&lt;p&gt;&lt;b&gt;ISSUE SUMMARY&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Case-insensitive indices are available in MongoDB 3.3.11 via the new &lt;em&gt;collation&lt;/em&gt; feature. Collations allow queries to match and sort UTF-8 string data in a locale-aware fashion, but also allow users to configure case sensitivity. For general documentation of collation, see &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1920&quot; title=&quot;Sort by collation&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1920&quot;&gt;&lt;del&gt;SERVER-1920&lt;/del&gt;&lt;/a&gt; and &lt;a href=&quot;https://docs.mongodb.com/manual/release-notes/3.3-dev-series-collation/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Development Series 3.3.x Collation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;TECHNICAL DETAILS&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Case-insensitivity can be specified as a collation with a strength of 2. This strength indicates that the collator should make case-insensitive comparisons. (Strength 1, the weakest comparison level, is both case-insensitive and diacritic-insensitive. Higher strengths are more discriminating whereas lower strengths are less discriminating.) Case-insensitivity, like any collation, can be specified at the level of an operation, an index, or as a collection default. Queries or index builds with no explicit collation will inherit the collection&apos;s default collation. An index is eligible for use by case-insensitive string matching or sorting operations if its case-insensitive collation matches that of the query.&lt;/p&gt;

&lt;h5&gt;&lt;a name=&quot;Example&quot;&gt;&lt;/a&gt;Example&lt;/h5&gt;

&lt;p&gt;The following example shows how to create and query a case insensitive index with English case folding rules:&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; db.myCollection.createIndex({city: 1}, {collation: {locale: &quot;en&quot;, strength: 2}});&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; db.myCollection.insert({_id: 1, city: &quot;New York&quot;});&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; db.myCollection.insert({_id: 2, city: &quot;new york&quot;});&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&amp;gt; db.myCollection.find({city: &quot;new york&quot;}).collation({locale: &quot;en&quot;, strength: 2});&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{ &quot;_id&quot; : 1, &quot;city&quot; : &quot;New York&quot; }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{ &quot;_id&quot; : 2, &quot;city&quot; : &quot;new york&quot; }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;&lt;b&gt;IMPACT ON DOWNGRADE&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Downgrade from 3.4 to 3.2 is illegal if the data files contain any collections with a case-insensitive default collation or any case-insensitive indices. Before downgrading, all collections and indices with an associated collation must be dropped.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;FURTHER INFORMATION&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Documentation for this feature is available in the &lt;a href=&quot;https://docs.mongodb.com/manual/release-notes/3.3-dev-series-collation/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;3.3.x development series release notes&lt;/a&gt;. To join our beta program for Case Insensitive Indices, and suggest improvements to our implementation, please email beta@mongodb.com.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;h6&gt;&lt;a name=&quot;Originaldescription&quot;&gt;&lt;/a&gt;Original description&lt;/h6&gt;

&lt;p&gt;potential syntax:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;db.foo.ensureIndex( { name : 1 } , { caseInsensitive : true } )&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;db.foo.ensureIndex( { name : 1 } , { caseInsensitive : true , locale : &quot;FR&quot; } )&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;db.foo.ensureIndex( { name : 1 } , { caseInsensitive : true , localeKey : &quot;user.country&quot; } )&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;db.foo.ensureIndex( { name : 1 } , { caseInsensitive : [ &quot;name&quot; ] } )&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;reminder, you can aways do this for now:&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{ name : { real : &quot;Eliot&quot; , sort : &quot;eliot&quot; } }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;ensureIndex( { &quot;name.sort&quot; : 1 } )&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</description>
                <environment></environment>
        <key id="10196">SERVER-90</key>
            <summary>case insensitive index</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="backlog-server-query">Backlog - Query Team</assignee>
                                    <reporter username="eliot">Eliot Horowitz</reporter>
                        <labels>
                    </labels>
                <created>Wed, 3 Jun 2009 09:05:00 +0000</created>
                <updated>Fri, 7 Apr 2023 12:31:19 +0000</updated>
                            <resolved>Tue, 23 Aug 2016 14:04:16 +0000</resolved>
                                                    <fixVersion>3.3.11</fixVersion>
                                    <component>Index Maintenance</component>
                                        <votes>359</votes>
                                    <watches>261</watches>
                                                                                                                <comments>
                            <comment id="1344665" author="rahul matte" created="Tue, 2 Aug 2016 15:04:57 +0000"  >&lt;p&gt;I am using below query to fetch the data in alphabetically sorted format&lt;/p&gt;

&lt;p&gt;collection.col.find(&lt;/p&gt;
{name: somename}
&lt;p&gt;).sort(&lt;/p&gt;
{name: 1}
&lt;p&gt;).toArray(function(error, namelist) &lt;/p&gt;
{...}
&lt;p&gt;)&lt;/p&gt;

&lt;p&gt;The query returns the sorted  data but  in  case sensitive format. &lt;/p&gt;
{
    &quot;name&quot; : &quot;AAA&quot;
}
&lt;p&gt;,&lt;/p&gt;
{
    &quot;name&quot; : &quot;BBB&quot;
}
&lt;p&gt;,&lt;/p&gt;
{
    &quot;name&quot; : &quot;aaa&quot;
}

&lt;p&gt;Can you please suggest any solution  to get the result in insensitive format like below&lt;/p&gt;
{
    &quot;name&quot; : &quot;aaa&quot;
}
&lt;p&gt;,&lt;/p&gt;
{
    &quot;name&quot; : &quot;AAA&quot;
}
&lt;p&gt;,&lt;/p&gt;
{
    &quot;name&quot; : &quot;BBB&quot;
}

&lt;p&gt;Is this reported bug applicable for my issue also..please help me I am new to the mongoDB&lt;/p&gt;</comment>
                            <comment id="1339258" author="dan@10gen.com" created="Thu, 28 Jul 2016 02:45:46 +0000"  >&lt;p&gt;Work on this feature is close to completion and scheduled to ship with 3.4.  Once it&apos;s ready in a development release we will provide documentation and we&apos;d love for you to give it a try.&lt;/p&gt;</comment>
                            <comment id="1339247" author="oleg@tmsprintsystems.com" created="Thu, 28 Jul 2016 02:26:24 +0000"  >&lt;p&gt;Is there any update on when to expect this feature?&lt;br/&gt;
It gets pretty messy to double sortable string fields amount when you have tens of them.&lt;/p&gt;</comment>
                            <comment id="1207655" author="jesperbendtsen83@gmail.com" created="Fri, 18 Mar 2016 08:42:35 +0000"  >&lt;p&gt;Really hope this feature comes in the near future, everyone are used to search in case insensitive way, it really creates headache for developers!&lt;br/&gt;
Meanwhile, I started to save strings with certain style, if I know the field is like that, rather than to create two fields, one for search/sort and one for display who can make the doc huge.&lt;/p&gt;

&lt;p&gt;Example in PHP&lt;br/&gt;
strToUpper () - Make a string uppercase&lt;br/&gt;
strtolower () - Make a string lowercase&lt;br/&gt;
ucfirst () - Make a string&apos;s first character uppercase&lt;br/&gt;
ucwords () - Uppercase the first character of each word in a string&lt;br/&gt;
none = Slow search&lt;/p&gt;

&lt;p&gt;So when users save data I change it to one of the above. And when users searching I change the input to above and then do the search/sort.&lt;br/&gt;
If I do not know if the field has a certain style. I use REGEX like this &quot;new MongoDB \ BSON \ Regex (&apos;^&apos;. $ Value. &apos;$&apos;, &apos;In&apos;)&quot; which is slow. I really waiting for MongoDB will support case insensitive search...&lt;/p&gt;

&lt;p&gt;Know the above is not super, but maybe it will help someone until case insensitive search comes, really hopes it comes!? This ticket is from 2009, it worries me! Please reply with future plans?&lt;/p&gt;</comment>
                            <comment id="1197583" author="betoneto.tbo@gmail.com" created="Wed, 9 Mar 2016 14:09:16 +0000"  >&lt;p&gt;Another good feature can also be pass a compare function for the sort method, like this:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;db.myEntity.find().sort(&lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;(myEntityA, myEntityB) { &lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;   &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; myEntityA.field.toLowerCase().compareTo(myEntityB.field.toLowerCase()); &lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;})&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;Sometimes you need to sort little data, and you doesn&apos;t want/need to create an index to do that.&lt;/p&gt;</comment>
                            <comment id="1167924" author="timhardy" created="Tue, 9 Feb 2016 16:01:24 +0000"  >&lt;p&gt;For the love of all that is good, PLEASE add case insensitive indexes!  Pretty much all web development involves the ability to search by string, and the standard is case insensitive.  &lt;/p&gt;

&lt;p&gt;When you type a search into Amazon, do you expect your search terms to be case sensitive?  No, you don&apos;t.  If you&apos;re a web developer and use MongoDb, you have to bend over backwards to provide this incredibly common capability.&lt;/p&gt;

&lt;p&gt;How Mongo can style itself as an enterprise option nowadays and not support this is beyond me. &lt;/p&gt;</comment>
                            <comment id="1163367" author="ther" created="Thu, 4 Feb 2016 08:36:47 +0000"  >&lt;p&gt;I also become more and more dependend on alternative sorting.&lt;/p&gt;

&lt;p&gt;I have been thinking about the issue and as I remember I have read somewhere that it was so important to MongoDB team to have fast sorting algorithm that they didn&apos;t want to complicate sorting process. &lt;/p&gt;

&lt;p&gt;So lets save data in sorting indexes the way that doesn&apos;t change sorting process. My proposal is to replace charachters (binary code) in String keys just before it is saved to index key, with characters provided by collation translation tabels. This also means that find algorithm should do the same operation before index searching is done.&lt;/p&gt;

&lt;p&gt;The other solution would be to replace characters before they are saved to document. As of MongoDB 3.2 encription is available, which does more or less the same thing. &lt;/p&gt;

&lt;p&gt;Mongo team. Please we are waiting alternative sorting for too long. &lt;/p&gt;

&lt;p&gt;by&lt;br/&gt;
Damjan Rems, &lt;a href=&quot;http://www.drgcms.org&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://www.drgcms.org&lt;/a&gt; &lt;/p&gt;</comment>
                            <comment id="1122709" author="dane@turbobuilt.com" created="Mon, 28 Dec 2015 07:04:24 +0000"  >&lt;p&gt;Hello guys... This is a very important feature for almost any application that deals with non-numeric search.  It does not make sense that I have to store two copies of every person&apos;s name just to get a search that is fast enough.&lt;/p&gt;</comment>
                            <comment id="1047503" author="josef.sabl" created="Wed, 30 Sep 2015 15:36:26 +0000"  >&lt;p&gt;It is very frustrating that this obvious thing is still unresolved. We are actually dumping MongoDB for Elastic Search for our search needs. Congrats &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/sad.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                            <comment id="990423" author="quochuy1602" created="Tue, 28 Jul 2015 07:46:05 +0000"  >&lt;p&gt;Please help me sort with char uppercase and lowercase&lt;/p&gt;</comment>
                            <comment id="714503" author="turneliusz" created="Tue, 9 Sep 2014 14:13:36 +0000"  >&lt;p&gt;Hope it helps guys, &lt;a href=&quot;http://derickrethans.nl/mongodb-collation.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://derickrethans.nl/mongodb-collation.html&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="714320" author="dotnetwise" created="Tue, 9 Sep 2014 07:54:33 +0000"  >&lt;p&gt;This is a must have in terms of easing very common basic usage. Too bad in 4 years nothing changed &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/sad.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                            <comment id="697039" author="john.page" created="Wed, 20 Aug 2014 17:18:17 +0000"  >&lt;p&gt;I believe are a couple of workarounds to this one of which is to do with the correct pay to page (i.e. never using $skip as many seem to).&lt;/p&gt;

&lt;p&gt;For a simple case insensitive search create a full text search index on the field, when querying query on the full text search index AND a case insensitive regex on the field to ensure no false positives.&lt;/p&gt;

&lt;p&gt;When paging - the important thing is to query every time for values greater than the last on the page of results - limit X where X is the page size. Sort and skip has you walking through the results or the index taking longer for each page - search &amp;gt; last value and sort is better (assuming an index to ensure you get them in order)&lt;/p&gt;

&lt;p&gt;If you use a case Sensitive index for this you do two searches limit pagesize with the first letter changed case then sort the results on display - so if the last thing on the page was&lt;/p&gt;

&lt;p&gt;&apos;john.page@mongodb.com&apos;&lt;/p&gt;

&lt;p&gt;Query for &amp;gt;= &apos;john.page@mongodb.com&apos; limit 10 &lt;br/&gt;
And in parallel &amp;gt;= &apos;John.page@mongoDB.com&apos;&lt;/p&gt;

&lt;p&gt;Then sort those results and show the first 10.&lt;/p&gt;

&lt;p&gt;Not perfect but still quite fast.&lt;/p&gt;

&lt;p&gt;You can only do this to page through results from the start - if you want to jump to a specific page it&apos;s a lot harder, but if you are indexing on other fields as well possibly not that hard.&lt;/p&gt;
</comment>
                            <comment id="649259" author="ceefour" created="Sat, 5 Jul 2014 19:48:02 +0000"  >&lt;p&gt;+1. &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=tshawkins&quot; class=&quot;user-hover&quot; rel=&quot;tshawkins&quot;&gt;tshawkins&lt;/a&gt; now that you mentioned it, yes we need &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-153&quot; title=&quot;javascript sort helper for custom sorting / indexing&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-153&quot;&gt;SERVER-153&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;but IMHO this one is more priority due to &lt;b&gt;extremely&lt;/b&gt; common usage.&lt;/p&gt;</comment>
                            <comment id="616935" author="ivan.fioravanti@4ward.it" created="Wed, 11 Jun 2014 13:31:05 +0000"  >&lt;p&gt;Again on this... the fact of not being able to do a case insensitive sort through an index is really becoming a blocking issue in some scenario, especially in big data world.  &lt;/p&gt;

&lt;p&gt;We&apos;ve already faced 2 situations where we need to perform sort and paging on quite large datasets (3M items) in order to display data in a web app.&lt;br/&gt;
The fact of using an additional column with &quot;toLower&quot; representation isn&apos;t really feasible because sort can be performed on many different fields.&lt;/p&gt;

&lt;p&gt;I imagine this is a nightmare from implementation point of view, but it&apos;s a really important feature when you&apos;ve to deal with large datasets. &lt;br/&gt;
Can you please give us an update on this topic? In order for us to decide if we have to think about a temporary workaround for our customers?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                            <comment id="592868" author="ivan.fioravanti@4ward.it" created="Thu, 22 May 2014 12:25:58 +0000"  >&lt;p&gt;I love MongoDB too and I&apos;m pushing its usage everywhere in our projects and for our customers. I&apos;m receiving many requests related to Case Insensitive search and I&apos;d really like to have this option built-in the product. For some customers we have used Elasticsearch for this and other usage, but it&apos;s too much for standard use.&lt;/p&gt;

&lt;p&gt;+1&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</comment>
                            <comment id="573070" author="pacohernandezg" created="Mon, 5 May 2014 15:40:21 +0000"  >&lt;p&gt;I am an advocate of MongoDB, I love the product, but I can not understand how something so common &amp;amp; so critical has not been addressed in over 4 years. &lt;/p&gt;

&lt;p&gt;The solution to duplicate columns doubles the space in disk, besides having to apply additional projections to prevent these fields are returned, and so on. Not an elegant solution, but it is the only one we have. &lt;/p&gt;

&lt;p&gt;Is there any hope that something will be implemented in the next version of Mongo?&lt;/p&gt;

&lt;p&gt;+1 To the creation of a special index.&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</comment>
                            <comment id="464613" author="ovi_mihai" created="Tue, 3 Dec 2013 12:30:36 +0000"  >&lt;p&gt;You can duplicate the column with all lowercase (maybe also replace characters with accents or special chars) then you do the search with a lowercase string.&lt;br/&gt;
If you do this you&apos;ll have to keep the consistency on edits&lt;/p&gt;</comment>
                            <comment id="298458" author="tshawkins" created="Tue, 26 Mar 2013 02:15:40 +0000"  >&lt;p&gt;@arkady&lt;br/&gt;
Unicode folding is required anyway for proper multilingual text search. &lt;/p&gt;</comment>
                            <comment id="267248" author="joelsand" created="Fri, 15 Feb 2013 17:16:40 +0000"  >&lt;p&gt;@Clifford - I also like your concept of using a function to compute the index value.  I&apos;d love to see this functionality in MongoDB!&lt;/p&gt;</comment>
                            <comment id="172541" author="philidem" created="Mon, 8 Oct 2012 15:41:20 +0000"  >&lt;p&gt;If this feature and Full-Text Searching (&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-380&quot; title=&quot;basic text indexing and search&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-380&quot;&gt;&lt;del&gt;SERVER-380&lt;/del&gt;&lt;/a&gt;) were available then I could see how MongoDB could replace other search technologies such as SOLR, Lucene, and Sphinx.&lt;/p&gt;

&lt;p&gt;@Clifford, good suggestion. However, I think the query engine might need a special syntax when using &lt;b&gt;find&lt;/b&gt; so that caller can clearly state that they are doing a case-insensitive search. I doubt you want to prevent the ability to do a case-sensitive search just because you have a case-insensitive index.&lt;/p&gt;

&lt;p&gt;Postgres has a similar feature:&lt;br/&gt;
&lt;a href=&quot;http://www.postgresql.org/docs/9.2/static/indexes-expressional.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://www.postgresql.org/docs/9.2/static/indexes-expressional.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Similar to Postgres, I think it should be possible to use the expression without the index (the index should be used to improve performance).&lt;/p&gt;

&lt;p&gt;Maybe something like this could be used:&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;// register a server-side function named &quot;lower&quot; that can be used to convert a field to lower case&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;db.system.js.save({&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    _id : &quot;lower&quot;,&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    value : function(fieldName) {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        return this[fieldName].toLowerCase();&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    }});&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;// index the lower case value of firstName&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;db.users.ensureIndex( { &quot;lower(&apos;firstName&apos;)&quot;: 1 } )&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;// find all users whose lower case first name starts with &quot;john&quot; (would match &quot;Johnny&quot;, &quot;John&quot;, &quot;john&quot;, etc.)&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;db.users.find({&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    &quot;lower(&apos;firstName&apos;)&quot; : {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        $regex : /^john/&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</comment>
                            <comment id="166138" author="parkan" created="Wed, 19 Sep 2012 20:48:53 +0000"  >&lt;p&gt;The lowercase index suggestion (as well as the current lowercase field workaround) don&apos;t really work outside ascii. Given that&lt;/p&gt;

&lt;p&gt;Reichwaldstra&#223;e &#8594; reichwaldstrasse&lt;br/&gt;
REICHWALDSTRASSE &#8594; reichwaldstrasse&lt;br/&gt;
&#972;&#963;&#959;&#962; &#8594; &#908;&#931;&#927;&#931;&lt;br/&gt;
&#908;&#931;&#927;&#931; &#8594; &#972;&#963;&#959;&#963;&lt;/p&gt;

&lt;p&gt;should REICHWALDSTRASSE match documents with Reichwaldstra&#223;e or reichwaldstrasse? &#908;&#931;&#927;&#931; to &#972;&#963;&#959;&#962; or &#972;&#963;&#959;&#963;? etc. You really need proper unicode case folding for these.&lt;/p&gt;

&lt;p&gt;That being said, very very needed feature, maybe even in a degraded ascii-only version.&lt;/p&gt;</comment>
                            <comment id="145067" author="eliot" created="Thu, 19 Jul 2012 20:21:44 +0000"  >&lt;p&gt;I think indexes on expressionsa re definitely something we want to do.&lt;br/&gt;
Thought a case insensitive index is a bit different than toLower because of sorting in different locales, etc...&lt;/p&gt;</comment>
                            <comment id="145055" author="idris" created="Thu, 19 Jul 2012 19:58:25 +0000"  >&lt;p&gt;+1 for Clifford&apos;s &lt;tt&gt;computed&lt;/tt&gt; idea&lt;/p&gt;</comment>
                            <comment id="145032" author="tanglebones" created="Thu, 19 Jul 2012 19:08:33 +0000"  >&lt;p&gt;Can we consider making this more general.&lt;br/&gt;
e.g.:&lt;/p&gt;

&lt;p&gt; db.users.ensure_index({name:{order: 1, computed: function() { return this.name.toLowerCase(); }});&lt;br/&gt;
 db.users.add(&lt;/p&gt;
{name: &quot;Bob&quot;}
&lt;p&gt;);&lt;br/&gt;
 db.users.find(&lt;/p&gt;
{name: &quot;BOB&quot;}
&lt;p&gt;); -&amp;gt; returns {_id:ObjectId(...), name: &quot;Bob&quot;}&lt;/p&gt;

&lt;p&gt;So the index on name, and queries against name, are passed through the &quot;computed&quot; logic.&lt;/p&gt;

&lt;p&gt;There are issues with using a surrogate field and placing this logic to populate the surrogate field in the applications accessing the db rather than in the indexing logic in the db:&lt;br/&gt;
&#8226;	applications (and their instances) can differ in their logic (e.g. bugs, version drift, multiple consuming applications, etc.)&lt;br/&gt;
&#8226;	the intent of the code is to make the index case insensitive, if the intent changes we&apos;d have to change all the applications (and their installs) accessing the data rather than changing the indexing function in the db once.&lt;br/&gt;
&#8226;	the surrogate field populated by the application would be exposed (e.g. you&apos;d have to add something like &quot;name_lowercase&quot;.)&lt;/p&gt;

&lt;p&gt;Of course having:&lt;/p&gt;

&lt;p&gt; db.users.ensure_index({name:{order:1, index_type: case_insensitive}});&lt;/p&gt;

&lt;p&gt;Where the index_ype is used to implement the index logic in C rather than javascript would be much faster. If you&apos;re open to that I&apos;d suggest having javascript computation as a type, e.g.:&lt;/p&gt;

&lt;p&gt; db.users.ensure_index({name:{order:1, index_type: javascript, javascript: function()&lt;/p&gt;
{ return this.name.toLowerCase();}
&lt;p&gt;}});&lt;/p&gt;

&lt;p&gt;Or even an FFI version that loads the indexing logic from a plugin:&lt;/p&gt;

&lt;p&gt; db.users.ensure_index({name:{order:1, index_type: ffi_cdecl, ffi_lib:&quot;custom.so&quot;}});&lt;br/&gt;
 extern &quot;C&quot; BSONObj Computed(BSONObj obj) &lt;/p&gt;
{ return ... }
&lt;p&gt; // C signature might be wrong, it&apos;s been a while since I&apos;ve done C...&lt;/p&gt;
</comment>
                            <comment id="119655" author="superduperjon" created="Tue, 15 May 2012 15:41:39 +0000"  >&lt;p&gt;Is it agreed that this shouldn&apos;t just be an index feature? Lookup via index or scan should behave consistently.&lt;/p&gt;</comment>
                            <comment id="108140" author="eliot" created="Tue, 10 Apr 2012 05:42:04 +0000"  >&lt;p&gt;You can look at &quot;fix for&quot; above to see when it is scheduled.&lt;/p&gt;</comment>
                            <comment id="107227" author="sonalsshah" created="Fri, 6 Apr 2012 06:33:24 +0000"  >&lt;p&gt;Any Idea when can it available?&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Sonal Shah&lt;/p&gt;</comment>
                            <comment id="105523" author="turneliusz" created="Sun, 1 Apr 2012 15:20:48 +0000"  >&lt;p&gt;+1 Major feature, and extremely important in every non-ascii database...&lt;/p&gt;</comment>
                            <comment id="104662" author="sonalsshah" created="Thu, 29 Mar 2012 09:17:55 +0000"  >&lt;p&gt;Any updates on this feature ? When can be it available. I need it badly.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Sonal Shah&lt;/p&gt;</comment>
                            <comment id="103380" author="eliot" created="Sun, 25 Mar 2012 19:45:30 +0000"  >&lt;p&gt;If you use utf8_unicode_ci in mysql, I believe it just ignores accents, etc...&lt;/p&gt;

&lt;p&gt;Or you can choose a specific language collation to get correct sorting.&lt;/p&gt;

&lt;p&gt;We could do that, I think the discussion is around whether there is a &quot;better&quot; solution.&lt;/p&gt;

&lt;p&gt;Likely not...&lt;/p&gt;</comment>
                            <comment id="103378" author="rlaferla" created="Sun, 25 Mar 2012 19:24:34 +0000"  >&lt;p&gt;How do other databases like Oracle/MySQL handle this?  MongoDB should be no different.&lt;/p&gt;</comment>
                            <comment id="73114" author="colinmollenhour" created="Wed, 14 Dec 2011 18:19:28 +0000"  >&lt;p&gt;If a field had a case-insensitive index, would queries match case-insensitively only when using the index? If so that could be very confusing.. What about &quot;ci&quot; operators like .find({&quot;foo&quot;:{$ciEq:&quot;bar&quot;}}) and .sort(&lt;/p&gt;
{&quot;foo&quot;:2}
&lt;p&gt;) and .sort(&lt;/p&gt;
{&quot;foo&quot;:-2}
&lt;p&gt;). Sorts and queries that don&apos;t specify &quot;ci&quot; operators or +/-2 would either not use the index or use the index only if it is case-sensitive (same behaviour as current). &quot;ci&quot; queries/sorts would use an index if available, but if not available would still do the correct matching/sorting (would be very slow of course).&lt;/p&gt;</comment>
                            <comment id="25994" author="remonvv" created="Wed, 16 Mar 2011 12:50:30 +0000"  >&lt;p&gt;I don&apos;t think localization is directly related to indexes and I doubt it should be part of ensureIndex syntax. &lt;/p&gt;

&lt;p&gt;Also, is there a specific spec available on how this will work internally? For example, will turning on the case insensitivity flag simply mean lowercase versions of strings are stored in the index for case insensitive sorts or will the actual index value be replaced with the lowercase version in which case query behaviour is affected. In other words, with this index flag on will find(&lt;/p&gt;
{a:&quot;Hi&quot;}
&lt;p&gt;) and find(&lt;/p&gt;
{a:&quot;hi&quot;}
&lt;p&gt;) return the same document?&lt;/p&gt;</comment>
                            <comment id="25956" author="idris" created="Tue, 15 Mar 2011 20:37:34 +0000"  >&lt;p&gt;If you read the comments or the end of the description, you&apos;ll see there&apos;s a workaround that will allow case-insensitive sorting, so no, it&apos;s not required.  However, that workaround is obviously less than ideal.&lt;/p&gt;</comment>
                            <comment id="25951" author="dougtmayer" created="Tue, 15 Mar 2011 20:28:20 +0000"  >&lt;p&gt;Has anyone looked at this in the last 8 months? In order to do case-insensitive sorting on the MongoDB server side, is this not effectively required?&lt;/p&gt;</comment>
                            <comment id="16211" author="eliot" created="Tue, 27 Jul 2010 17:12:40 +0000"  >&lt;p&gt;For short term - I would just add a 2nd field that you call .toLower() on before inserting.&lt;br/&gt;
Then you can sort on that.&lt;/p&gt;</comment>
                            <comment id="16209" author="squarelover" created="Tue, 27 Jul 2010 17:07:29 +0000"  >&lt;p&gt;What timeframe is expected to add this feature? Users are complaining about how our sorts are case sensitive. Is there an alternate way of sorting records on a key in a case-insensitive fashion? &lt;/p&gt;</comment>
                            <comment id="13398" author="eliot" created="Fri, 2 Apr 2010 15:37:04 +0000"  >&lt;p&gt;trying to keep 1.5/1.6 very focused on sharding + replica sets.&lt;br/&gt;
will try to get it out asap so we can go back to features like these&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="13313">SERVER-1920</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                                        </outwardlinks>
                                                                <inwardlinks description="is duplicated by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="150786">SERVER-14784</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="275066">DOCS-7503</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>39.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25143"><![CDATA[Query]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <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_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[500A000000UaXwsIAF]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 27 Jul 2010 17:07:29 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        7 years, 28 weeks, 1 day ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<s><a href='https://jira.mongodb.org/browse/SERVER-1920'>SERVER-1920</a></s>, <s><a href='https://jira.mongodb.org/browse/WRITING-1651'>WRITING-1651</a></s>]]></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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-266</customfieldvalue>
                        </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_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            7 years, 28 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>parkan</customfieldvalue>
            <customfieldvalue>backlog-server-query</customfieldvalue>
            <customfieldvalue>quochuy1602</customfieldvalue>
            <customfieldvalue>tanglebones</customfieldvalue>
            <customfieldvalue>colinmollenhour</customfieldvalue>
            <customfieldvalue>d_rems@yahoo.com</customfieldvalue>
            <customfieldvalue>dane@turbobuilt.com</customfieldvalue>
            <customfieldvalue>dan@mongodb.com</customfieldvalue>
            <customfieldvalue>dougtmayer</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>ceefour</customfieldvalue>
            <customfieldvalue>idris</customfieldvalue>
            <customfieldvalue>ivan.fioravanti@4ward.it</customfieldvalue>
            <customfieldvalue>jesperbendtsen83@gmail.com</customfieldvalue>
            <customfieldvalue>joelsand</customfieldvalue>
            <customfieldvalue>john.page@mongodb.com</customfieldvalue>
            <customfieldvalue>superduperjon</customfieldvalue>
            <customfieldvalue>josef.sabl</customfieldvalue>
            <customfieldvalue>dotnetwise</customfieldvalue>
            <customfieldvalue>oleg@tmsprintsystems.com</customfieldvalue>
            <customfieldvalue>ovi_mihai</customfieldvalue>
            <customfieldvalue>pacohernandezg</customfieldvalue>
            <customfieldvalue>philidem</customfieldvalue>
            <customfieldvalue>Rahul Matte</customfieldvalue>
            <customfieldvalue>remonvv</customfieldvalue>
            <customfieldvalue>rlaferla</customfieldvalue>
            <customfieldvalue>betoneto.tbo@gmail.com</customfieldvalue>
            <customfieldvalue>squarelover</customfieldvalue>
            <customfieldvalue>sonalsshah</customfieldvalue>
            <customfieldvalue>timhardy</customfieldvalue>
            <customfieldvalue>tshawkins</customfieldvalue>
            <customfieldvalue>turneliusz</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrpy2f:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4177</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_11861" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>User Summary</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="11858"><![CDATA[Completed]]></customfieldvalue>

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

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