Elements in mongodb array values are saved in order

  mongodb, question

For example, I have a value already saved in mongodb

[
 1,
 2,
 5,
 4,
 3,
 ...
 ]

Want to update to this

[
 1,
 2,
 3,
 4,
 5,
 ...
 ]

How to achieve the highest efficiency, assuming that the content of this array is about 100k and has thousands of elements

With aggregate, first unwind, then sort.