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:
db.solarSystem.executePipeline( collection => collection.match( allPass([ document => new RegExp('O2').test( document.?atmosphericComposition) document => (temp => temp >= -40 && temp <= 40)( document.?meanTemperature) ]) ).then( collection => collection.addField( 'hasMoons', document => document.numberOfMoons > 0) ).then( 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.