In Darktable is there any way to create a new sort order using LUA?

When viewing a collection, Darktable lets you change the sort order using the “sort by” dropdown. Let’s say there is a sort order I want to do that isn’t listed there. For example sorting but some custom metadata tag.

Is this possible using Lua scripting? I looked through the API but couldn’t find any obvious way to do it.

Good question and welcome to the forum!