Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Full stack web development Course | 113. DELETION AND DOCUMENTATION
Play lesson

Full Stack Web Development Tutorial Course - Full stack web development Course | 113. DELETION AND DOCUMENTATION

4.0 (3)
36 learners

What you'll learn

This course includes

  • 26.3 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

Full-stack web development Tutorial in Just 3 Weeks Week 3: Day 2 Section 12: Intro to Node, Mongo, & REST APIs Tutorial 113: DELETION AND DOCUMENTATION In this video tutorial, we are going to learn the use of the remove command in MongoDB. Remove() command is used to remove a document from the collection. Command- db.collection.remove({criteria}) Example: db.collection.remove({"product name": pink car}) This will delete the data related to pink car in the collection. Some Of the commands learned in the previous video are: To see all the databases in your system Command: show dbs Example: show dbs Result: Local 0.78125GB Test 0.23012GB It will show all the databases present in your system. To check your currently used database Command: db It will display the name of the currently used database. To create a new database Command: use DATABASE_NAME Example: To create a database with the name Xyz Syntax: use Xyz Your created database is not present in the list when you enter - show dbs. To display the newly created database, you need to insert at least one document into it. Command: db.collection_name.insert({ "description1":name1,"description2":name2}) Example: dbs.products. insert({"product name":car,"price":10,20,000}) To select documents in a collection Command: db.collection.find() Example: db.products.find({"product name":car,"price":10,20,000}) To format the printed result,you can add .pretty() to the operation Command: db.collection.find().pretty() Update- To update a document, MongoDB provides update operators, such as $set , to modify field values. Command: Database.collection.update({ field1: value1, ... }) Example: db.products.update({"product name": car},{ $set:"price": 12,00,00}) Some update operators, such as $set , will create the field if the field does not exist. Command: db.collection.updateOne() It is used to update a single existing document in the collection. Command: db.collection.updateMany() It is used to update many documents in an existing collection. FindOne- It is used to find specific data or query in the collection. Command: db.collection.findOne({query}) Some of the important terms to learn while using MongoDB: Server- A server is a computer that provides data to other computers. It is connected to other devices through LAN or WAN. There are different types of servers and each type runs specific software according to the purpose of the server. Terminal- It is an electronic or electromechanical hardware device that can be used for entering data into and transcribing data from a computer and computing device. App.use- it is a way to register middleware or chain of middlewares before executing any end route logic or intermediary route logic depending upon the order of the middleware registration sequence. Express/express.js- it is a back end web application framework for node.js. It is free and open-source software. It is designed to build web applications and APIs. Npm- It is the package manager for the Node Javascript platform. It is used to publish, discover, install, and develop node programs. JSON- Javascript Object Notation is an open standard file format and data interchange format. It is commonly used for transmitting data in web applications. Body parser- It allows express to read the body and then parse that into a JSON object that we can understand.

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere