Getting CoreMongooseArray instead of normal array

This worked for me!

const history = Array.from([...result.history])

CoreMongooseArray seems to be inheriting the Array type and has almost the same behavior.

Source code (at the time of writting) :

In case you want to convert it to a simple array, just do this :

const history = Array.from(...result.history)

Beware, if this array contains objects, each object will have undesirable additional Mongoose properties, as they are Mongoose schemas documents. You will need to convert them into plain JavaScript objects :

const history = Array.from(...result.history).map(v => v.toJSON())

Hope it helps.