Published onOctober 8, 2026MongoDB 用 $and / $or 查「年、月分開存」的日期區間mongodb當日期拆成 year/month 兩個欄位存時,示範如何用 $or 包起點與終點條件、再用 $and 組合出區間查詢,並說明為什麼不能把兩個 $or 放在同一層物件裡。