BDA Assignment5
BDA Assignment5
BDA Assignment5
Ro 1 No: B-5
Asignment No-5.
. 1
Descibe key Feahure of
9schema -less Daabaje
Mongo DB.
Tisfheqenera eaure povidel by the Mongo DB
ASChema-ess olb mcans ne collecli on ho lof
oli ffcrent ype of documeoly in t po in ohc
words in he mongoDB d a
single collcc io
Can hold mulhple documenS and these do (ymenb
fmay Co nsis the eliff no offields,
Size 1t s
onto?
not
oecess 9Yy ha he one documen}
SStmilar to andhe r docyment ike in he e lahonad
db. Dute to this cool fcokut Mongo DB p o v ides
pyo
9preate ftextbili hy db
T h e Docume ot Data Model Doument Oien ted
MongoDB all
the dala sto r d in doc 4me ots
nstcad of tables fike in RDBM5. t o thtse dorymen ,
the data is Storeol i n fields Keyvadu e) pauir inStead
Of rowS and colu nS tw hich make the data muchb
OT fiexibICin co mparison fo RDBMS nd Cach
oment Contains itsu0ique object îcd.
Tdexing
To MongoDB db eve Held in the documentsis
jodexed with prima ndary in dices this
makes easie and takey less Fime
ime to gc SY Sea Ch
eata ro m the the data. Tf
poo of the dota
s 0o in dexed Then db Seach
, each oocme ot
twith the 5pecihedqyerywhich takey lo ts of
ime Qocl nst So eficient
Scalabilityi
MongoDB povides hoi zo nta sca/cahi ity ith
c ih the
helps of at sharding.3hqsding mean fo dsibuhe
data o0 muliple SelveS ,hcC alarge arnoynt
f deta is parhhoned into dalo chunks using the
Sha's ed koy qnd hese data chunks a r e eveolly
diSibued a Cro35 9hards ha eside QtTOSS
many phys Cal seveNs. will also add nC
maChies to arunoing db
RepliCaHon
Mon9o DB
provicdes high avoilability and Tednda0
i th
twith fhe
y
help ofcpli Cahion, it Cr col roulhpl
Copies of daa and Sends these topieto a
diff sCVeSo ha i OC ers
erS fails h
1he daBa sedrieved 1o anothe Sert ve
Aggregoion
TH allows o pe Fofm operg ali10ns t h e guoup ed
ata ancd ge sin11e esul1 (ompuled or
pmnaY
ReplaHon. Rep icaHon
a)Iosevt
This com mand is
S Usedto insert document too a
Collection
Syntax
db. Collechion-Name .insext Cdocyment)
Example
db useaS. insestEI
1 bje ctTd C" 56 7A91elloclg 7cderkoea
hte MonqoDB
DBOveiew".
desmp Hoo " Mo ngoD8 i50o SQL Dg
likes l00
4
UpdaingComplex daa
0an update he Complex daa follo Ir.
Cmd
Co ecion. tpacae-6 Updae One
CollecHon. UpdaeMaoy
CollecHon Replare One
Example
>we mdb
2 Iosext
nax
db Collectionoame insert l doyment)
db CotlechonoCme. insert
Exampe
dbusenS. insesl
Objec{1 d c 5o7fhle8lo c13729de860ea,
itle "Mo ngo DB
3 Find
wed o selcc docum ents in a colle chion and eturn
O
Curso to he seleckd coments.
Synax
olb (o llcchon..nqme, find 0
Example
dbusens fincd )
dnop C1
used o
d1op exis tiog lafabaue
S10fax dopDaabase ()
SConditionau Update
Used foY updatiog
Syntax
Jb collectHon na me . tind Ooe Aod Upd ate (seecion cmteia
updaled-dauta)
db-collechoon.ame updateOne C«Alk>updake
olb Collec hon_agme. updotel)any filk?, Upcdate>)
EXample
dempsod O.oe Apd Updale
I fixst0ame Radhika
se Age 30 em.ail
Last_name" shgxma
3
2 db emp. tOeeA-Updale One
modihied Couot
6) limit
limi C ued Fox limi
documens ha you 00of ecoTds Oy
wJan
Sntax HYsO limiEC)
0
db. Collechootld me.find&query)li mit
7750t soumbe )
wed to speciies The Orde io which
etusns the matchin documents the e y
qey
fsom
Collection the9)ven
Syntax bollecHon 0om.eSoxt1field
pame II)
a99tgae-
Use o f0ey he dala e co1ds Ldocuments
Computed slt
Syotas
Operchon)
db callection. name atgate (Agqregar
Examele
tismcol.aggtae CE 2-id
TIS 930up by-
Oututoial 2sum 31)
St lgqq ak exptssi on
irs e-
sum 10v min max push
eta_e2 ulvaltot_0
00RDBNS. ables
doukabaes.
A Coliecon exists cwithina Single
aSchema
CollecHoo do not_enforce
clotu.me.nts
nts_ithina collechon Can have diff
-
ields
ypicaullyall dacu.mens incallechionsQe ut
Simila O elated Purpse
CCreahnq the losge Collechon and ange quey
Usin9 follo09 Sntax Lwe Can CrEcoe Colltc11
Syntax
db.reate ollecHon Cnameop tions
Example
db eate Cóllection myCollech on