Hello, have been playing around with doing some pagination / sorting and one thing I’ve stumbled upon is that when doing a sort within a find clause, sorting is case sensitive. For example:
Animals.find({}, {sort:{"name": 1});
Results in:
Cat
Dog
bobcat
From what I’ve read this is a limitation of MongoDB, what’s the recommended approach for doing case insensitive sorting in Meteor?
One approach seems to be to add an additional column that contains down-cased data. This seems a little hacky; especially if one wanted to enable sorting on a large number of columns, you’d be duplicating potentially a lot of data just in order to perform sorting.
An optional transformation function.
Documents will be passed through this function before being
returned from fetch or findOne , and before being
passed to callbacks of observe , map , forEach
, allow , and deny . Transforms are not applied
for the callbacks of observeChanges or to cursors
returned from publish functions.