Why yet another query language

why not accept some bytecode, then provide a means to write a pipeline in the client language and submit it, maybe compiled locally or stored procedure

I mean this stuff feels like yet another query language with the usual terminology and syntax rules, but if you have a rich API on a cursor that is yet to exist and will only exist inside the db cluster, instead of this, we might write:

    collection => collection.match(
          document => new RegExp('O2').test(
          document => (temp => temp >= -40 && temp <= 40)(
       collection => collection.addField(
              document => document.numberOfMoons > 0)
       collection => collection.pick(['name', 'hasMoons'])

I’m not saying this formulation is somehow better than the aggregation framework presented in this course. But it is simpler because the application program text can all follow the same rules. Just as the above example is written how I might write the rest of the app, a Python adaptation could be possible and would look like Python app code.

Great question! We have a great community forum where you can have an in-depth conversation about specific use cases and interesting problems that you get to solve using MongoDB. I would highly recommend posting your question there for a more involved discussion.

Kind Regards,