W e will discuss in detail about the Shell input/output redirections. Most Unix system commands take input from your terminal and send the resulting output back to your terminal. A command normally reads its input from the standard input, which happens to be your terminal by default. Similarly, a command normally writes its output to standard output, which is again your terminal by default. Output Redirection The output from a command normally intended for standard output can be easily diverted to a file instead. This capability is known as output redirection. If the notation > file is appended to any command that normally writes its output to standard output, the output of that command will be written to file instead of your terminal. Check the following who command which redirects the complete output of the command in the users file. $ who > users Notice that no output appears at the terminal. This is because the output has been redirected from the default standard o...
The find() Method To query data from MongoDB collection, you need to use MongoDB's find() method. Syntax The basic syntax of find() method is as follows − >db.COLLECTION_NAME.find() find() method will display all the documents in a non-structured way. Example Assume we have created a collection named mycol as − > use sampleDB switched to db sampleDB > db . createCollection ( "mycol" ) { "ok" : 1 } > And inserted 3 documents in it using the insert() method as shown below − > db . mycol . insert ([ { title : "MongoDB Overview" , description : "MongoDB is no SQL database" , by : "tutorials point" , url : "http://www.tutorialspoint.com" , tags : [ "mongodb" , "database" , "NoSQL" ], likes : 100 }, { title : "NoSQL Database" , description : "NoSQL database doesn't have tables" , by : "tutoria...
PostgreSQL numeric functions are used primarily for numeric manipulation and/or mathematical calculations. The following table details the numeric functions − ABS(X) The ABS() function returns the absolute value of X. Consider the following example − testdb =# SELECT ABS ( 2 ); +---------------------------------------------------------+ | ABS ( 2 ) | +---------------------------------------------------------+ | 2 | +---------------------------------------------------------+ 1 row in set ( 0.00 sec ) testdb =# SELECT ABS (- 2 ); +---------------------------------------------------------+ | ABS ( 2 ) | +---------------------------------------------------------+ | 2 | +---------------------------------------------------------+ 1 row in set ( 0.00 se...
Comments
Post a Comment