0% found this document useful (0 votes)
25 views3 pages

WDFP Practical Question Set A

The document outlines a series of programming tasks involving Node.js and MongoDB commands. It includes creating web applications with features like displaying messages, handling file uploads, and implementing middleware, as well as performing various database operations such as inserting, updating, and deleting documents. Each section specifies requirements for both Node.js programs and corresponding MongoDB commands.

Uploaded by

ramya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views3 pages

WDFP Practical Question Set A

The document outlines a series of programming tasks involving Node.js and MongoDB commands. It includes creating web applications with features like displaying messages, handling file uploads, and implementing middleware, as well as performing various database operations such as inserting, updating, and deleting documents. Each section specifies requirements for both Node.js programs and corresponding MongoDB commands.

Uploaded by

ramya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

1. i) Write a node.

js program for the following


a) Display a message in the browser
b) Display the current date and time in the browser
c) Pass a query string in URL
ii) Write a mongoDB command to insert multiple documents into the
students collection.

2. i) Write a node.js program for the following


a) Splits up a web address into readable parts
b) Display customized error message
ii) Write mongoDB commands for the following
a) How do you find a document where the name is "John" in the users
collection?
b) How would you find all documents in the products collection where
the price is greater than 100?

3. i) Write a node.js program for the following


a) Fileupload operation
b) Event handling
ii) Write mongoDB commands for the following
a) Update the age of a student named "Alice" to 25 in the students
collection
b) update the status field to "active" for all documents in the employees
collection

4. i) Write an Express.js program for the following


a) Implementation of 2 middlewares
b) Filtering paths using URL prefix
ii) Write mongoDB commands for the following
a) How do you delete a single document where the email is
"[email protected]" in the contacts collection?
b) Write a MongoDB command to delete all documents in the orders
collection where status is "canceled".
5. i) Write an Express.js program for the following
a) Setting the status code
b) Parsing data from request
ii) Write mongoDB commands for the following
a) Write a query to find all documents in the students collection where
age is between 18 and 25.
b) Write a MongoDB query to find all documents in the books collection
that contain the word "MongoDB" in the title field.

6. i) Write an Express.js program for the following


a) Setting the status code
b) Parsing data from request
ii) Write mongoDB commands for the following
a) Update the age of a student named "Alice" to 25 in the students
collection
b) update the status field to "active" for all documents in the employees
collection

7. i) Write an Express.js program for the following


a) Implementation of 2 middlewares
b) Filtering paths using URL prefix
ii) Write mongoDB commands for the following
a) Update the age of a student named "Alice" to 25 in the students
collection
b) update the status field to "active" for all documents in the employees
collection

8. i) Write a node.js program for the following


a) Fileupload operation
b) Event handling
ii) Write mongoDB commands for the following
a) Write a query to find all documents in the students collection where
age is between 18 and 25.
b) Write a MongoDB query to find all documents in the books collection
that contain the word "MongoDB" in the title field.
9. i) Write a node.js program for the following
a) Splits up a web address into readable parts
b) Display customized error message
ii) Write mongoDB commands for the following
a) Write a MongoDB command to find the first 5 students sorted by age
in descending order.
b) Write a MongoDB query to find all documents in the books collection
that contain the word "MongoDB" in the title field.

10. i) Write a node.js program for the following


a) Display a message in the browser
b) Display the current date and time in the browser
c) Pass a query string in URL
ii) Write mongoDB commands for the following
a) How do you update the email of a specific user in the customers
collection where the customerID is 12345?
b) Write a MongoDB command to add a status field with the value
"inactive" to all documents in the users collection.?

You might also like