I want to make a data length limit, for example, if the length of a collection in a database exceeds 1000, sort by time, delete the old data, and then add new data.
now is the length limit and sorting I am more clear, but after sorting why remove did not understand, what should I do?