Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Submitted
Categories Atlas Search
Created by Guest
Created on Feb 10, 2025

Allow null value in "in" operator

Allow null value in the "in" operator. This will help reducing code to query if a document has a specific ID or null. Helpfull when you have documents connected to a organization and/or a project. So you can filter ```{ in: { path: "project", value: [null, ID] }}``` Currently you have to filter this with a combination of filter, compound, should and equals with a minimumShouldMatch: 1. ``` { compound: { should: [ { equals: { path: 'project', value: null, }, }, { equals: { path: 'project', value: req.project._id, }, }, ], minimumShouldMatch: 1, }, } ```