I am writing a chat application in node js express js, can we make such a mongodb query in redis database? I'm trying to use hscan and hvals for the query, but if anyone has an idea, can it help?
const msg = await messageModel.findOne({
$or: [{
$and: [{
senderId: {
$eq: myId
}
}, {
reseverId: {
$eq: fdId
}
}]
},
{
$and: [{
senderId: {
$eq: fdId
}
}, {
reseverId: {
$eq: myId
}
}]
}
]
}).sort({
updatedAt: -1
})