ObjectId is not defined is getting when execute the query using eval() function

I am trying to execute the below query

// Query and code
const db = await this.client.db(dbName);
query = “db.collection(‘connections’).find({_id:ObjectId(‘647ecb01456961fe30dcacab’)})”;
let queryData = await eval(
(async () => {let data =’ +
query +
‘\n return await data.toArray()})()’,
);
resolve(queryData);

in that case, the object id not defined is getting the error

{
“message”: “ObjectId is not defined”,
“status”: “Failed”,
“data”: null
}

what is the solution for that