How to sort documents based on $in order?
<p>I have array of ObjectIds like the following:</p>

<p><code>var list = [{_id: ObjectId(1)}, {_id: ObjectId(2)}, {_id: ObjectId(3)}];</code></p>

<p>I need to query these documents by the following query:</p>

<pre><code>Post.find({_id: {$in: list}}).exec(function (err, posts) {
    console.log(posts);
});
</code></pre>

<p>But unfortunately the order of <code>posts</code> is random. What is the best way to make proper order based on <code>list</code> array?</p>