@@ -16,19 +16,19 @@ const uri = '<connection string>'; // Add your MongoDB connection string here
16
16
17
17
// begin-sample-data
18
18
const docs = [
19
- { title : "Inception" , year : 2010 , rated : "PG-13" , released : "2010-07-16" } ,
20
- { title : "Interstellar" , year : 2014 , rated : "PG-13" , released : "2014-11-07" } ,
21
- { title : "The Dark Knight" , year : 2008 , rated : "PG-13" , released : "2008-07-18" } ,
22
- { title : "Tenet" , year : 2020 , rated : "PG-13" , released : "2020-09-03" }
19
+ { title : "Inception" , year : 2010 , rated : "PG-13" , released : "2010-07-16" } ,
20
+ { title : "Interstellar" , year : 2014 , rated : "PG-13" , released : "2014-11-07" } ,
21
+ { title : "The Dark Knight" , year : 2008 , rated : "PG-13" , released : "2008-07-18" } ,
22
+ { title : "Tenet" , year : 2020 , rated : "PG-13" , released : "2020-09-03" }
23
23
] ;
24
24
// end-sample-data
25
25
26
26
// begin-insert
27
27
const bulkOps = [
28
- { insertOne : { document : { title : "Inception" , year : 2010 , rated : "PG-13" , released : "2010-07-16" } } } ,
29
- { insertOne : { document : { title : "Interstellar" , year : 2014 , rated : "PG-13" , released : "2014-11-07" } } } ,
30
- { insertOne : { document : { title : "The Dark Knight" , year : 2008 , rated : "PG-13" , released : "2008-07-18" } } } ,
31
- { insertOne : { document : { title : "Tenet" , year : 2020 , rated : "PG-13" , released : "2020-09-03" } } }
28
+ { insertOne : { document : { title : "Inception" , year : 2010 , rated : "PG-13" , released : "2010-07-16" } } } ,
29
+ { insertOne : { document : { title : "Interstellar" , year : 2014 , rated : "PG-13" , released : "2014-11-07" } } } ,
30
+ { insertOne : { document : { title : "The Dark Knight" , year : 2008 , rated : "PG-13" , released : "2008-07-18" } } } ,
31
+ { insertOne : { document : { title : "Tenet" , year : 2020 , rated : "PG-13" , released : "2020-09-03" } } }
32
32
] ;
33
33
34
34
await movies . bulkWrite ( bulkOps ) ;
@@ -38,8 +38,8 @@ const uri = '<connection string>'; // Add your MongoDB connection string here
38
38
39
39
// Inserting additional movies
40
40
const additionalMovies = [
41
- { title : "Dunkirk" , year : 2017 , rated : "PG-13" , released : "2017-07-21" } ,
42
- { title : "Memento" , year : 2000 , rated : "R" , released : "2000-09-05" }
41
+ { title : "Dunkirk" , year : 2017 , rated : "PG-13" , released : "2017-07-21" } ,
42
+ { title : "Memento" , year : 2000 , rated : "R" , released : "2000-09-05" }
43
43
] ;
44
44
await movies . insertMany ( additionalMovies ) ;
45
45
0 commit comments