TypeError: D:\YandexDisk\nodeProjects\HSKWiKi5\views\mixins\wordBlock.pug:5
3| h1= word.characters
4| ul
> 5| each variants in lang === 'R' ? word.ruTranslation : word.enTranslation
6| li= variants.pinyin
7| ul
8| each variant in variants.speachParts
Cannot read property 'length' of undefined
app.get('/search', async (req, res) => {
let lang = req.cookies.lang;
let {query: {q: searchingBy }} = req;
let arr = await Word.find({
characters: {
$in: [...searchingBy] // когда characters есть в массиве searchingBy
}
});
searchingBy = arr;
res.render('search', {
pageTitle: 'Search',
searchingBy,
lang
});
});