Author: admin
-
Subroutines
A Perl subroutine or function is a group of statements that together performs a task. You can divide up your code into separate subroutines. How you divide up your code among different subroutines is up to you, but logically the division usually is so each function performs a specific task. Perl uses the terms subroutine,…
-
Node.js MongoDB Create Database
To create a database in MongoDB, First create a MongoClient object and specify a connection URL with the correct ip address and the name of the database which you want to create. Note: MongoDB will automatically create the database if it does not exist, and make a connection to it. Example Create a folder named…
-
Node.js Create Connection with MongoDB
MongoDb is a NoSQL database. It can be used with Node.js as a database to insert and retrieve data. Download MongoDB Open the Linux Command Terminal and execute the following command: It will download the latest MongoDB according to your system requirement. Install MongoDB After the complete download, use the following command to install MogoDB.PlayNextMute…
-
Date and Time
This chapter will give you the basic understanding on how to process and manipulate dates and times in Perl. Current Date and Time Let’s start with localtime() function, which returns values for the current date and time if given no arguments. Following is the 9-element list returned by the localtime function while using in list context − Try the…
-
Node.js MySQL Drop Table
The DROP TABLE command is used to delete or drop a table. Let’s drop a table named employee2. Create a js file named “delete” in DBexample folder and put the following data into it: Now open command terminal and run the following command:PlayNextMute Current Time 0:00 / Duration 18:10 Loaded: 2.94%  Fullscreen Verify that the table employee2 is…
-
Node.js MySQL SELECT Unique Record
(WHERE Clause) Retrieve a unique data from the table “employees”. Create a js file named selectwhere.js having the following data in DBexample folder. Now open command terminal and run the following command: Node.js MySQL Select Wildcard Retrieve a unique data by using wildcard from the table “employees”.PauseNextMute Current Time 0:10 / Duration 18:10 Loaded: 4.77%  Fullscreen Create a…
-
Operators
What is an Operator? Simple answer can be given using the expression 4 + 5 is equal to 9. Here 4 and 5 are called operands and + is called operator. Perl language supports many operator types, but following is a list of important and most frequently used operators − Lets have a look at all…
-
Node.js MySQL Select Records
Example Retrieve all data from the table “employees”. Create a js file named select.js having the following data in DBexample folder. Now open command terminal and run the following command:PauseNextMute Current Time 0:03 / Duration 18:10 Loaded: 3.67%  Fullscreen You can also use the statement:
-
Node.js MySQL Delete Records
The DELETE FROM command is used to delete records from the table. Example Delete employee from the table employees where city is Delhi. Create a js file named “delete” in DBexample folder and put the following data into it:PlayNextMute Current Time 0:01 / Duration 18:10 Loaded: 3.30%  Fullscreen Now open command terminal and run the following command: You…
-
Loops
There may be a situation when you need to execute a block of code several number of times. In general, statements are executed sequentially: The first statement in a function is executed first, followed by the second, and so on. Programming languages provide various control structures that allow for more complicated execution paths. A loop…