0 votes
96 views
in MEAN by (0 points)
closed by
From the below code snippet, Identify the database name and the collection name.

var mongodb=require(^ prime mongod * b' );

var mongoclient=mongodb.MongoClient;

var url=" mongodb:/ 1ocalhost .27017^ * ,

mongoclient.connect(url,( use Unified Topology: true ),(connerror.conn)=>{

if(connerror)

console.log("Some Error, Connect was NOT Established...");

} else {

console.log("Connection Successfully Established. "); var db=conn db(^ prime myd * b' ),

db.collection('employees').find()).toArray((err, data)

if (err) {

console log("Some Error, Data Couldnot be Fetched..."),

}else{

console.log("Data Found") console.log("Data="data),

conn.close()

closed

1 Answer

0 votes
by (0 points)
 
Best answer
Database Name is mydb, and collection name is employees

Related questions

0 votes
1 answer 164 views
0 votes
1 answer 115 views
0 votes
1 answer 110 views
asked Jun 4, 2023 in MEAN by Admin (0 points)
0 votes
1 answer 114 views

2.8k questions

2.8k answers

0 comments

76 users

Welcome to MCQ Village Q&A, where you can ask questions and receive answers from other members of the community.
...