A
A
Anime Flame2022-01-20 19:29:58
Mongoose
Anime Flame, 2022-01-20 19:29:58

Sorting from largest to smallest in an array object?

Good evening, I need Mongodb database sorting

"Admins": [],
    "Deposits": {
        "Start": 500,
        "Balance": 2950,
        "All": 5000
    },
    "Guild": {
        "Id": 9,
        "Name": "Toxic",
        "Description": "uWu",
        "RoleId": "933600716923207701",
        "RoleColor": "#A600FF",
        "CreatedAt": 1642658156124
    },


I need to sort the Id field inside the Guild object and output to the console documents from 1 position to 10 (Id)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vlad Osadchyi, 2022-01-20
@AnimeFlame

https://stackoverflow.com/questions/61046584/mongo...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question