Check out example codes for "move collection mongo db cli". It will help you in understanding the concepts better.

Code Example 1

use admin db.runCommand({renameCollection:"funnel.countries",to:"test.countries"})

Learn ReactJs, React Native from akashmittal.com