Ob1Ju4n / mongo-cert-tracker

Project repository for tracking work related to the MongoDB Associated Developer certification
0 stars 0 forks source link

Identify the correct syntax for the JAVA driver to insert one document and to insert many documents #41

Closed Ob1Ju4n closed 2 weeks ago

Ob1Ju4n commented 2 months ago

Add code that uses the proper driver syntax to inert one document and insert many documents

Ob1Ju4n commented 2 weeks ago

Steps to insert:

  1. Using the MongoDatabase instance, get the MongoCollection where documents will be created
  2. Create an instance of Document you want to insert and pass it to the collection.insertOne() method
  3. If adding more than one document, use the insertMany() and pass a list of the documents to create