MongoServerError: BSON field 'insert.documents.0' is the wrong type 'array', expected type 'object'

При попытке перевести FindCursor в массив вылезает ошибка

let a = await Servers.find({ name: guild.name, id: guild.id }).toArray()
callback(new error_1.MongoServerError(document));
                             ^

MongoServerError: BSON field 'insert.documents.0' is the wrong type 'array', expected type 'object'

Весь метод:

async function getLocalization(guild) {
    let a = await Servers.find({ name: guild.name, id: guild.id }).toArray()
    console.log(a)
    a = a[0]

    let language = a['language']
    let b = language.split('-')

    if (b[0] === 'ru') {
        return ru[b[1]]
    }
    else if (b[0] === 'en') {
        return en[b[1]]
    }
}
// ru и en это значения из jsonа

Без .toArray() работает, но не выводит то что надо


Ответы (0 шт):