1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to MongoDB in Python

Connected

Exercise

Inserting multiple documents

Sometimes, you need to add multiple documents at once—instead of calling .insert_one() over and over. MongoDB's .insert_many() lets you do just that.

Instructions

100 XP
  • Finalize the definition of new_movies by setting the titles: "arrival" and "m3gan", respectively.
  • Insert the movies into the movies collection of the film database.
  • Print out the auto-generated ids of the newly inserted document.