When I try to query, the result contains the _id field with "new ObjectId()" in it. How to avoid this "new ObjectId()" and only include the hash value as string. Because of this issue, sending the data back as JSON response is failing.
The following is a basic demo:
My code for querying:
book_data = await Book.find({ slug: 'test' }).
where('status').equals('Active').select('title').exec()
console.log( book_data )
Response:
[
{
_id: new ObjectId("6164aff742da0eac31a87b9a"),
title: 'Test'
}
]