The syntax for running directly on MongoDB shell is different from using Python library (e.g. PyMongo)
In used lambda functions, you would see two queries:
QUERY
: This can run directly on MongoDB shell (e.g. Mongo Compass > Connect > Click the button shell)PIPELINE
: This is the equivalent (almost, date calculation might differ a bit) query to run with Python library (e.g. PyMongo)
Some useful tutorials:
https://docs.aws.amazon.com/lambda/latest/dg/getting-started.html
https://docs.aws.amazon.com/lambda/latest/dg/getting-started-create-function.html
https://docs.aws.amazon.com/lambda/latest/dg/code-editor.html
https://docs.aws.amazon.com/lambda/latest/dg/python-package-update.html
(Under "Updating a function with runtime dependencies")