Copy / clone database tables to other server

I’m migrating a server. What’s the recommended way to copy over some tables to a new server, preferable maintaining collection properties and indexes?
Is it possible with tools like https://docs.mongodb.com/database-tools/mongodump or only by writing an export/import cloud function?

In the future you may have direct access to mongo db and you could do that dump.
For now you can do that import/export with a cloud function.