Currently the autocomplete endpoint performs an aggregation within the controller itself, putting together a new aggregation pipeline for each request. As this is relatively inefficient and messy, the aggregation pipeline for this has instead been added to the database itself as a view called DAG.
The controller should be modified to pull results from this view instead of generating the pipeline itself.
Currently the
autocomplete
endpoint performs an aggregation within the controller itself, putting together a new aggregation pipeline for each request. As this is relatively inefficient and messy, the aggregation pipeline for this has instead been added to the database itself as a view calledDAG
.The controller should be modified to pull results from this view instead of generating the pipeline itself.