I have some records in two databases (MySQL and MariaDB), that I must sort using natural sort. In mysql I use function and triggers from this: https://stackoverflow.com/a/12257917/1408681 but not sure, how can I generate such string in MongoDB. I also use PHP, so it isn't a problem to generate such string before update record, and then use for sorting.
But... how? I'm looking for function to generate special string from string, which can be then used to natural sorting.