skip to Main Content

Mongodb – How to index a mongo complex query

I really don't understand how to improve the performance of my query using index. db.Vendite.aggregate([{$group: { _id: { anno: "$anno", mese: "$mese", cod_age: "$cod_age", cod_int: "$cod_int", cod_cli: "$cod_cli", cod_linea_comm: "$cod_linea_comm", cod_sett_comm: "$cod_sett_comm", _art: "$cod_art"}, vendite_quantita: { $sum: { $add: […

VIEW QUESTION

Mongodb – How to sort by the smallest value from multiple fields?

I have list of mongo documents [ { "created_at": "2024-03-15T18:11:18.687", "updated_at": "2024-03-15T18:11:28.945", "fields": { "contract_first": [], "contract_second": [ { "position": "Bob" } ], "uuid": "bf031b46-ec33-4c61-ad33-a3ad2cbeb9cb" }, "id": "65f46520928f6fd496ffbe6d" }, { "created_at": "2024-03-15T18:11:18.687", "updated_at": "2024-03-15T18:15:26.838", "fields": { "contract_first": [ { "position":…

VIEW QUESTION
Back To Top
Search