I am trying to call an aggregation pipeline with parameters as part of my server code within eve.
The documentation and the code on the [github]https://github.com/pyeve/eve/blob/master/eve/methods/get.py#L122 suggests that I should be able to call the pipeline using get_internal and it should run with the parameters passed to it.
I have been trying
get_internal("pipeline", **{'_id': id, 'time': time})
but it appears that the _id and time parameters are not getting passed to the aggregate query.
I have verified that the pipeline is working by visiting the pipeline URL
<baseurl>?aggregate={"_id":"5fa904807d3037e78023a5192,"time":1604827480260}
but I would prefer to call it from within the server side code, rather than making a request if possible.
Is there something obvious that I am doing wrong here.
Thanks
Unfortunately, you can not use parameters with
get_internaland aggregation._perform_aggregationonly uses the immutable request object while_perform_findmergeswherefrom the request object with yourlookupparameters with an$and.You could do a http request to the url like you show works or you could use
app.data.driverand manually perform the aggregation query by importing the pipeline and modifying it manually:And please do create an issue at https://github.com/pyeve/eve/issues for this missing feature