Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Insert a document

# Your code here

Exercises

Exercise

Simulate inserting a document: write insert_document(collection, doc) which assigns a unique _id and appends the doc to the collection (a list). Return the inserted document.