📘 Premium Read: Access my best content on Medium member-only articles — deep dives into Java, Spring Boot, Microservices, backend architecture, interview preparation, career advice, and industry-standard best practices.
🎓 Top 15 Udemy Courses (80-90% Discount): My Udemy Courses - Ramesh Fadatare — All my Udemy courses are real-time and project oriented courses.
▶️ Subscribe to My YouTube Channel (176K+ subscribers): Java Guides on YouTube
▶️ For AI, ChatGPT, Web, Tech, and Generative AI, subscribe to another channel: Ramesh Fadatare on YouTube
The use Command
Syntax
use DATABASE_NAME
Example
> use mydb
switched to db mydb
> db
mydb
> show dbs
local 0.78125GB
test 0.23012GB
> db.posts.insertOne({
"id": 1,
"title": "MongoDB Overview",
"description": "Post about MongoDB Overview",
"content": "HTML content here",
"tags": [
"Java",
"MongoDB"
]
})
> db.posts.find();
{ "_id" : ObjectId("5e175a59bb7bb02737b82435"), "id" : 1,
"title" : "MongoDB Overview", "description" : "Post about MongoDB Overview",
"content" : "HTML content here", "tags" : [ "Java", "MongoDB" ] }
> show dbs
admin 0.000GB
config 0.000GB
local 0.000GB
mydb 0.000GB
users 0.000GB
Comments
Post a Comment
Leave Comment