# Creating Documents

## 📌 insertOne() <a href="#creating-documents-insertone" id="creating-documents-insertone"></a>

Click the create collection button. Then click the insert document button.

**\_id** is the unique id for every document in mongodb

Using mongo shell:

```
db.COLLECTION_NAME.insertOne({title: "this is a title", year: 1900})
```

## 📌 insertMany() <a href="#creating-documents-insertmany" id="creating-documents-insertmany"></a>

Using mongo shell:

```
db.COLLECTION_NAME.insertMany([{_id: "123"},{_id:"124"}])
```

Insert many does an **ordered insert** by default, this means that as soon as this finds an error it will stop inserting documents.

To change the behavior of ordered insert, add after the array a document:

```
{"ordered": false}
```
