@@ -35,24 +35,24 @@ an ObjectId value to the new document. See
3535
3636.. example::
3737
38- To insert a new document into the ``sample_mflix.movies`` collection:
38+ To insert a new document into the ``sample_mflix.movies`` collection:
3939
40- .. code-block:: javascript
40+ .. code-block:: javascript
4141
42- use sample_mflix
42+ use sample_mflix
4343
44- db.movies.insertOne(
45- {
46- title: "The Favourite",
47- genres: [ "Drama", History" ]
48- runtime: 121,
49- rated: "R",
50- year: 2018,
51- directors: [ "Yorgos Lanthimos" ],
52- cast: [ "Olivia Colman", "Emma Stone", "Rachel Weisz" ],
53- type: "movie"
54- }
55- )
44+ db.movies.insertOne(
45+ {
46+ title: "The Favourite",
47+ genres: [ "Drama", " History" ],
48+ runtime: 121,
49+ rated: "R",
50+ year: 2018,
51+ directors: [ "Yorgos Lanthimos" ],
52+ cast: [ "Olivia Colman", "Emma Stone", "Rachel Weisz" ],
53+ type: "movie"
54+ }
55+ )
5656
5757 :method:`~db.collection.insertOne()` returns a document that
5858 includes the newly inserted document's ``_id`` field value.
@@ -64,10 +64,8 @@ an ObjectId value to the new document. See
6464
6565 db.inventory.find( { title: "The Favourite" } )
6666
67- .. note::
68-
69- To ensure you return the document you inserted, you can instead
70- query by ``_id``.
67+ To ensure you return the document you inserted, you can instead
68+ query by ``_id``.
7169
7270Insert Multiple Documents
7371-------------------------
0 commit comments