-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmongodb.js
More file actions
28 lines (23 loc) · 885 Bytes
/
Copy pathmongodb.js
File metadata and controls
28 lines (23 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// const { MongoClient, ObjectId } = require('mongodb')
// const id = new ObjectId();
// console.log(id);
// console.log(id.getTimestamp());
// const connectionURL = `mongodb+srv://togadiya:togadiya@cluster0.uvacu.mongodb.net/myFirstDatabase?retryWrites=true&w=majority`
// MongoClient.connect(connectionURL, { useNewUrlParser: true, useUnifiedTopology: true }, (errror, client) => {
// if (errror) {
// return console.log(`Error : ${errror}`);
// }
// const db = client.db('task-manager');
// // db.collection('user').insertMany([{
// // name: 'Nayan',
// // age: '19'
// // }, {
// // name: 'Shakti',
// // age: '19'
// // }], (error, result) => {
// // if (error) {
// // return console.log(`Error : ${error}`)
// // }
// // console.log(result, result.ops);
// // })
// });