Follow us on: facebook twitter linkedin

DATABASE

Basic operation at MongoDB

Post by : John deo
Post date: 2024-05-30 14:35:35

Read time : 2 minute
Total views: 277 times
hero-img

MongoDB known as no sql db which one based on JSON structure document oriented database. Before drive into MongoDB make sure compass and mongo shell installed in  ur pc or laptop. Now open command prompt and type mongosh.

Operation list:

  • Create database type use database_name.
  • Create collection type db.createCollection(collection_name) or db.collection_name.insertOne(data_set).
  • Insert data type  db.collection_name.insertOne(data_set) or  db.collection_name.insertMany([data_set,data_set,data_set]).
  • Show data type db.collection_name.find() or db.collection_name.findOne().

 

Note: In MongoDB a database or collection is not actually created untill its get content. 

 

 

Share by:

Keep exploring

Read what excites, achieves and moves us Read what excites, achieves and moves us