for example, the order in which I typed is {id: {$in: [1pg4]}}, how can I make the results returned by mongodb return the corresponding data in this order?
for example, the order in which I typed is {id: {$in: [1pg4]}}, how can I make the results returned by mongodb return the corresponding data in this order?
what a strange requirement.
now that you know in advance what rules to sort by. Find the data and sort it in the application.
Previous: There is a large number of visits to web, whether the session is stored in mongodb or redis?.
Next: What do you do with the original data after mongodb adjusts the schema?