Skip to Main Content
Builder.io Ideas
Created by Julius Dorfman
Created on May 31, 2023

Case Insensitive In-Query Sort for Content-API

Origin: https://forum.builder.io/t/case-insensitive-sort/3624

Clients concern is having to iterate over each pagination of 100 results and then sort.


Goal: Allow user to designate case insensitivity in-query.


Currently: builder.getAll returns data and the output is: ["AB", "Aa"] when the desired output is ["Aa", "AB"]



Example Usage:

const data = await builder.getAll('logo', {

limit: 10,

options: {

sort: {

data: {

company: { $regex: searchQuery, $options: "i" },

caseSensitivity: false

}

},

noTargeting: true,

includeUnpublished: showUnpublished(),

}

});

Output: ["Aa", "AB"]

  • Attach files