skip to Main Content

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