Let us create a collection with documents −> db.demo738.insertOne({Subjects:["C", "C++"]}); { "acknowledged" : true, "insertedId" : ObjectId("5ead696557bb72a10bcf0661") } > db.demo738.insertOne({Subjects:["MySQL", "PL/SQL"]}); { "acknowledged" : true, "insertedId" : ObjectId("5ead696657bb72a10bcf0662") }Display all documents from a collection with the help of find() method −> db.demo738.find();This will produce the following output −{ "_id" : ObjectId("5ead696557bb72a10bcf0661"), "Subjects" : [ "C", "C++" ] } { "_id" : ObjectId("5ead696657bb72a10bcf0662"), "Subjects" : [ "MySQL", "PL/SQL" ] }Following is the query to push −>db.demo738.update({_id:ObjectId("5ead696657bb72a10bcf0662")}, {$push:{"Subjects":"MongoDB"}}); WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })Display all documents from a collection with the help of ... Read More
Use the background-repeat property to display the background image only once. You can try to run the following code to implement the background-repeat property −ExampleLive Demo body { background-image: url("https://www.tutorialspoint.com/videotutorials/images/tutor_connect_home.jpg"); background-repeat: no-repeat; } Background Image
To order by timestamp, use sort() in MongoDB. Let us create a collection with documents −> db.demo737.insertOne({"timestamp" : new ISODate("2020-04-01" )}); { "acknowledged" : true, "insertedId" : ObjectId("5ead682157bb72a10bcf065c") } > db.demo737.insertOne({"timestamp" : new ISODate("2020-10-31" )}); { "acknowledged" : true, "insertedId" : ObjectId("5ead682757bb72a10bcf065d") } > db.demo737.insertOne({"timestamp" : new ISODate("2020-05-02" )}); { "acknowledged" : true, "insertedId" : ObjectId("5ead682a57bb72a10bcf065e") }Display all documents from a collection with the help of find() method −> db.demo737.find();This will produce the following output −{ "_id" : ObjectId("5ead682157bb72a10bcf065c"), "timestamp" : ISODate("2020-04-01T00:00:00Z") } { "_id" : ObjectId("5ead682757bb72a10bcf065d"), "timestamp" : ISODate("2020-10-31T00:00:00Z") } { "_id" : ... Read More
To set the responsive font size, use the ‘viewport width’ and set it to ‘vw’ unit. You can try to run the following code to use ‘vw’ unit −ExampleLive Demo h1 { font-size:8vw; } This is demo heading This is demo text.
Use the CSS :hover selector to style links on mouse over with CSS. You can try to run the following code to implement the :hover selector −ExampleLive Demo a:hover { background-color: orange; } Qries Keep the mouse cursor on the above link and see the effect.
To change the root username in MySQL, you need to use UPDATE and SET command. The syntax is as follows −UPDATE user set user = ’yourNewUserName’ WHERE user = ’root’;To understand the above syntax, let us switch the database to MySQL using USE command.The query is as follows to switch the database.mysql> use mysql; Database changedNow list all the users from MySQL.user table. The query is as follows −mysql> select user from MySQL.user;The following is the output −+------------------+ | user | +------------------+ | Manish | | User2 ... Read More
To select the element that has focus, use the: focus selector. You can try to run the following code to implement the: focus selector −Example input:focus { background-color: green; } Subject Student: Age:
MongoDB insertOne() inserts a document into a collection, whereas updateOne() update a single document in a collection based on a query filter.Let us create a collection with documents −> db.demo735.insertOne({id:1, Name:"Chris"}); { "acknowledged" : true, "insertedId" : ObjectId("5ead51b657bb72a10bcf0652") } > db.demo735.insertOne({id:1, Name:"David"}); { "acknowledged" : true, "insertedId" : ObjectId("5ead51bb57bb72a10bcf0653") } > db.demo735.insertOne({id:1, Name:"Bob"}); { "acknowledged" : true, "insertedId" : ObjectId("5ead51be57bb72a10bcf0654") } > db.demo735.insertOne({id:1, Name:"Carol"}); { "acknowledged" : true, "insertedId" : ObjectId("5ead51c757bb72a10bcf0655") }Display all documents from a collection with the help of find() method −> db.demo735.find();This will produce the following output −{ "_id" ... Read More
Use the :focus selector to select the element that has focus. You can try to run the following code to implement the :focus selectorExample input:focus { background-color: green; } Subject Student: Age:
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP