i have a model that contain field state type of enum and accept only three values
active
disabled
deleted
and currently am filtering to get all the active ones by
const query = {state : "active" ... other filters here}
const posts = await post.find(query)
but I have a case where I need to get the posts that have stated both active and disabled and I searched in mongoose docs for something I can use but I find nothing at the moment i want something clean that achieve this code
const query1 = {state : "active" ... other filters here}
const posts1 = await post.find(query1)
const query2 = {state : "disabled" ... other filters here}
const posts2 = await post.find(query2)
const posts = {...posts1, ...posts2}