I got a filed "tags" and it has value ["tag1", "tag2", ...] and I got a tag named "tag1" from req.body.tag.
I want to find a tag where tags[...].name = "tag1" how?
this is what I tried
api.post('/findByTag', async(req, res) => {
if(!req.body.tag || req.body.tag === 'string') return
let tag = Array.from(req.body.tag)
try {
let memos = await Memo.find({})
.where('tags')
.in(tag)
.limit(30)
res.status(200).json({ data: memos })
} catch(err) {
logger.error(err.message, err)
res.status(500).json({ message: err.message })
}
})