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 Planned
Categories Compass
Created by Guest
Created on Oct 4, 2021

Possibility to set variables used in pipeline stages

Hi ! It would be really handfull to have the possibility to use variables in the pipeline stages: var userId = ObjectId("5f61dfadc1e8960001700da8'") { $match : {user.id : userId} } for complex queries, it would avoid having to modify the id at each stages. Thanks !
  • Attach files
  • Guest
    Oct 19, 2021
    I 100% agree. Using variables for the same date matching in different stages would be another usefulll example.