I created a table with the following values:
[
{
id: 1,
name: "abc"
},
{
id: 2,
name: "lmn"
},
{
id: 3,
name: "xyz"
}
]
My query includes $in as follows:
{
id: {
$in: [ 2, 3, 1 ]
}
}
I am hoping for the output to be in this order:
[
{
id: 2,
name: "lmn"
},
{
id: 3,
name: "xyz"
},
{
id: 1,
name: "abc"
}
]
However, the actual output is not arranged as desired. Is there a method to achieve the expected output?