Need details on usage of $orderby

In the documentation it says that orderby can be used to retrieve a limited number of results from the database, ordered by value some attribute.

Example: https://…/api/content/geodata/cities?$orderby=data/population/iv desc$top=20

I can get it work on values that are not string type, but not on string type values. I would like to retrieve the objects that were most recently created or most recently updated, and both of these values are stored as strings that contain the date.

Does orderby actually work on strings? If it doesn’t, what is a recommended way to sort by created without having to do it in the front end?

Thank you for your advice