mern_lab_program_ans
mern_lab_program_ans
Ans)
# inserting data
db.employees.insertOne({
name: "John Doe",
position: "Software Engineer",
salary: 75000,
department: "Engineering",
hireDate: new Date("2023-01-01")
})
db.employees.updateOne(
db.employees.updateMany(
{ $set: { salary: 85000 } } // Set the 'salary' field to 85000 for all matching
documents
)
2)(b). Build a Basic React App that Display “Hello World!”
Ans)
cd hello-world-app
Navigate to src/App.js:
Replace the existing code with a simple component that displays "Hello World!":
npm start
db.restaurants.find()
db.restaurants.find().pretty()
6)(b). Create a REST backend API with Express ?
Ans)
Method 1 :
console.log("Hello World");
node hello.js
node hello.js