Meteor Sort Case Insensitive

Is there a way to make case insensitive sorting of the Meteor collection? If so, which code would I add to the following?

var movies = Movies.find({}, {sort: {name: 1}}); 

Or is it the only alternative right now to use Underscore (or some other vanilla JS) on the extracted data?

 var movies = Movies.find().fetch(); return _.sortBy(movies, function(movie) { // do your sorting here }); 
+4
source share
1 answer

MongoDB (at least as in 2.2.0) does not support case insensitive indexes.

The general basic approach is to add an indexed string version of the field to which you want to search, and then string search terms when searching from your application. You can update the search field when your documents are inserted / updated.

A more flexible search may take this by adding a source field to several indexed search terms using stems, stop words and other search strategies.

See also: Full-text search in MongoDB .

You can view or vote in the SERVER-90 feature request ("Case insensitive index") in the MongoDB Problem Tracker.

+2
source

All Articles