Posts

Showing posts with the label mongodb

Mongo DB - Topics

Image
   Topics 01.Mongo DB - Introduction 02.Mongo DB - Download and install mongoDB 03.Mongo DB - Commands which we use in mongoDB. 04.Mongo DB - Mongo DB - Spring Boot Project 05.Mongo DB - Query part 1 (Create,Insert,Update,Drop,Remove,Find,limit,skip,sortAND,OR,INDEX) 06.Mongo DB - Query part 2 (Aggregation) 07.Mongo DB - Query part 3 (MongoDB Backup and Restore) 08.Mongo DB - Query part 4 (Query Example) 09.Mongo DB - ALL

01.Mongo DB - Introduction

Image
  Mongo DB Mongo DB  යනු  noSql open source database  එකක්   වේ . SQL database  හෙවත්  relational database  වලදී  data table  වල   තබා   ගන්න   අතර   මෙම  table table  අතර  relationship  ද   පවතී . නමුත්  mongoDB  වලදී  data  පවතිනුයේ  document collection  එකක්   ලෙසට   වන   අතර   මෙම  documents  අතර  relations  නැත . එනම්  documents are not related with each other.  Schema free  වන   අතර  this is based on binary JSON  එනම්  BSON. Mongo DB simple query language  එක   ලෙස  simple query language  එක   බාවිතා   කරනු   ලබයි  (SQL  වගේ ).  SQL and MongoDB Comparison. Table – Collection Row – Document Column – File Collection is not strict about what goes in it (it’s schema-less).  

02.Mongo DB - Download and install mongoDB

Image
   Download and install mongoDB Go to  https://www.mongodb.com/try/download/community  and  download mongoDB. Note: version 4.4.1 is only support in windows 10.If you want to install other versions of windows, please select an older mongo dB version.   Alter install go to bellow path… C:\Program Files\MongoDB\Server\3.6\bin Inside bin there are 2 excitable file can be seen. mongod.exe and mongo.exe ·       Mogod.exe. Mongo daemon which is going to run in the background it will accept the connections. ·       Mong.exe. command line shell from which you are going to work with your database.   Running mongoDB If you want to run mogoDB, first you have to run mongod.exe then run mongo.exe. To run, open C:\Program Files\MongoDB\Server\3.6\bin this location with cmd. In the CMD, type  monod.exe  and press enter to run. පළමු   පාර  run  කරන   විට   පහත...

03.Mongo DB - Commands which we use in mongoDB.

Image
   Commands which we use in mongoDB. Create a database use company   // create a database If it is already exist provide it, otherwise create it. View all databases show   dbs Database  එකක් අලුතෙන්  create  කර මෙම  command  එක  run  කලද එම අලුත්  database  එකට document එකක්  add  වන තුරු   එම d atabase  එක පෙන්වන්නේ නැත. Drop a data base db . dropDatabase ()  //Dropping a current woking database     Create a collection. db . createCollection ( "branch" ) db . branch . insert ({ "code" : "001" , "name" : "branch one" }) // create a document. Inhere branch Collection also create and then document is created. View Collections show collections  // show created collection   View Collection data db . branch . find ()   Drop a Collection db . employee . drop ()  // remove collection   Adding Document. මෙහෙදී  Binary Jason Format  හෙවත්  BSON  එක...