Hi,
Could anyone guide me to the specific section of the MongoDB source code where the logic for aggregation operations, such as Add, Subtract, and Multiply, is implemented?
Hi,
Could anyone guide me to the specific section of the MongoDB source code where the logic for aggregation operations, such as Add, Subtract, and Multiply, is implemented?
@steevej If you have any insights on this, they would be greatly appreciated.
mongo/src/mongo/db/pipeline/expression.cpp at master · mongodb/mongo · GitHub might be a good place to start looking.
Thank you @alexbevi for your response! I appreciate your insights and help.
Hello @alexbevi ,
I have tried profiling the mongodb code using perf command for the script that does aggregate operation(sum, avg), but to my surprise i didn’t see any of the function calls from expression.cpp (functions like ExpressionAdd,…).
Also, i observe that expression.cpp file is not a part of BUILD.bazel. Does that mean by default mongodb doesn’t use this file while building mongodb?
Thank you in advance if you could clearify this.
Unfortunately I’m not the right person to ask (I was just poking around the codebase - I’m not a server engineer).
If you want to summarize exactly what it is you’re trying to accomplish it would make it easier for someone with more experience in this space to jump in.
Thank you so much for the active response @alexbevi
To summarize what i am exactly trying to do, I have written a python script to perform aggregate operation and while running the script i am collecting the profiling data using Perf tool.
In the profiling data, i am looking for the function calls that are inside expression.cpp where the code for add,mul is present. But to my surprise i didn’t see any function calls from expression.cpp .
@steevej , will you be able to help in this?
Sorry I have no clue.