'MongoDB Update document and change position in collection

I have a react-beautiful-dnd Kanban with tasks. The tasks are rendered by the stored order in MongoDB.

On the Kanban, when I change the position of a task from 3 to 55, I want to update the task in MongoDB and move it from position 3 to 55 in the collection.

Is that possible?

If not, any ideas on how to solve that problem?

Update: Collection currently looks like this:

    _id: ObjectId("6284ad4053fc5bd9f17908e0")
    columnId: "625ebad450ff6f16df133053"
    stepId: "6257b090c9677c26b4c9c274"
    title: "Task 1"
    priority: "Low"

    _id: ObjectId("6284aab153fc5bd9f1790892")
    columnId: "625ebad450ff6f16df133054"
    stepId: "6257b090c9677c26b4c9c275"
    title: "Task 2"
    priority:"Medium"
    
    ...


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source