Im getting random data from my database using aggragate but its converting its array properties to string
const book = await Book.aggregate([
{
$sample: { size: 6 } }
]);
desired result
{"title": "Analysis, Vol I", "author": "Tao, Terence", "genre": [ "mathematics" ],}
Result im getting
"title": "Analysis, Vol I", "author": "Tao, Terence", "genre": "mathematics"
How can I fix this? I want get array from the genre so that I can loop through it