I have a collection of documents with a large array.

How correctly, for example, to delete several elements of an array, change the order (sort) or add a new element to the end? Need to reload an array?

    1 answer 1

    Use operations to work with arrays. With the help of them you can modify the array in different ways.

    https://docs.mongodb.com/manual/reference/operator/update-array/

    If the array is so large that the search operations of the element take a long time, then you can make an index on the array.

    https://docs.mongodb.com/manual/core/index-multikey/