Fetch specific keys from array of objects

Hi Team,
Could someone help to fetch particular keys instead of entire object.

using await collection.find({_id: {’$in’: _ids }}).toArray(); to fetch entire object. Is there way to filter only 2 of the keys from that object.
Object :

[
    {
        "_id": “abc”,
        “key1”: “value”,
        “key”2: “some value,
        “req1”: 1,
        "req2”: “222”
    },
    {
        "_id": “xyz”,
        “key1”: “value”,
        “key”2: “some value,
        “req1”: 2,
        “req2”: “333”
    },
] 

instead of entire object, can we have

[
{ "req1": 1,
   "req2": 222
},
{ "req1": 2
   "req2": 333
}]

Note: used project to achieve that but not seen any performance.
could anyone help any other better approach?

Thanks

Projection is how you reshape the document being returned to the client - what exactly do you mean by not seen any performance? Do you mean it didn’t work correctly? It worked but was slow? Something else? Please provide the full syntax you tried, what happened and also what version this is.

Asya

sorry my understanding was wrong. Time taken to convert cursor.toArray() while finding multiple documents. using Nodejs mongo version: “3.5.9”