<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>mongo DB &#8211; The SIGMA</title>
	<atom:link href="https://danushka96.github.io/sigma/index.php/tag/mongo-db/feed/" rel="self" type="application/rss+xml" />
	<link>https://danushka96.github.io/sigma/</link>
	<description>&#60;For Those Who Code/&#62;</description>
	<lastBuildDate>
	Sat, 02 Mar 2019 16:57:34 +0000	</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.1.1</generator>
	<item>
		<title>Angular7 මුල සිට ඉගෙන ගනිමු-1 කොටස</title>
		<link>https://danushka96.github.io/sigma/index.php/2019/01/16/angular7/</link>
				<comments>https://danushka96.github.io/sigma/index.php/2019/01/16/angular7/#comments</comments>
				<pubDate>Wed, 16 Jan 2019 03:41:40 +0000</pubDate>
		<dc:creator><![CDATA[Gayan Sampath]]></dc:creator>
				<category><![CDATA[angular.js]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[angular]]></category>
		<category><![CDATA[MEAN]]></category>
		<category><![CDATA[mongo DB]]></category>
		<category><![CDATA[nodejs]]></category>
		<category><![CDATA[npm]]></category>

		<guid isPermaLink="false">https://danushka96.github.io/sigma/?p=1551</guid>
				<description><![CDATA[<p><span class="rt-reading-time" style="display: block;"><span class="rt-label">Reading Time: </span> <span class="rt-time">3</span> <span class="rt-label rt-postfix">minutes</span></span> මුලින්ම ආයුබෝවන් කියනවා යාලුවෝ හැමෝටම..ගොඩ කාලෙකට පස්සේ ඔන්න මං ඇරගෙන ආවා අලුත්ම පාඩම් මාලාවක්..thesigma blog අඩවියත් සමග නිරන්තරයෙන් රැදී සිටි යාලුවෝ නම් දන්නවා අපි කලින් අපි කලින් පාඩමේ කතා කලා MEAN stack වල Database system එක වන mongoDB ගැන..ඒ පාඩම් ටික කලින් මඟ හැරුන කෙනෙක් ඉන්නවනම් මෙතනින් ගිහින් බලන්න පුලුවන්..අද<a class="moretag" href="https://danushka96.github.io/sigma/index.php/2019/01/16/angular7/"> Read more&#8230;</a></p>
<p>The post <a rel="nofollow" href="https://danushka96.github.io/sigma/index.php/2019/01/16/angular7/">Angular7 මුල සිට ඉගෙන ගනිමු-1 කොටස</a> appeared first on <a rel="nofollow" href="https://danushka96.github.io/sigma/">The SIGMA</a>.</p>
]]></description>
								<content:encoded><![CDATA[<span class="rt-reading-time" style="display: block;"><span class="rt-label">Reading Time: </span> <span class="rt-time">3</span> <span class="rt-label rt-postfix">minutes</span></span>
<p>මුලින්ම ආයුබෝවන් කියනවා යාලුවෝ හැමෝටම..ගොඩ කාලෙකට පස්සේ ඔන්න මං ඇරගෙන ආවා අලුත්ම පාඩම් මාලාවක්..thesigma blog අඩවියත් සමග නිරන්තරයෙන් රැදී සිටි යාලුවෝ නම් දන්නවා අපි කලින් අපි කලින් පාඩමේ කතා කලා  MEAN stack  වල Database system එක  වන mongoDB  ගැන..ඒ පාඩම් ටික කලින් මඟ හැරුන කෙනෙක් ඉන්නවනම් <a href="https://danushka96.github.io/sigma/index.php/category/web-development/mean-stack/">මෙතනින්</a> ගිහින් බලන්න පුලුවන්..අද මම පටන් ගන්න යන්නේ ඒ පාඩම් මාලාවේ දෙවන දිගහැරුමයි..ඒ තමයි  <strong>Angular</strong>  .</p>



<p>ඇත්තටම කියනවනම් Angular කියන්නේ ඉතාම කෙටි කාලෙකින් මෑත කාලීනව ගොඩක් ජනප්‍රිය වුන javascript front end framework(client side frame work) එකක්.2016  September 14  තමයි මුලින්ම Angular හදුන්වා දෙන්නේ..ඊටපස්සේ 2017 march 23 දී Angular version 4 ද, 2017 november 1 දී Angular version 5 ද, 2018  May 4 දී Angular version 6 ද හදුන්වා දෙනවා ..මං මේ post එක ලියන මේ මොහොතේ තියන latest ම version එක තමයි 2018  October  මාසයේ හදුන්වා දුන් Angular version 7..පේනවනේ නේද  මේ  frame work එක දියණු වෙලා තියන ඉක්මන😃😃😃..ඇත්තටම Angular හදුන්වා දුන්නේ google වුනාට microsoft ලාගේ typescript language එකත් මේකේ තියනවා..ඒ ගැන අපි පස්සේ හෙමීට බලමුකෝ..😀😀</p>



<p>ඇත්තටම  මොකද්ද    මේ  Angular වල තියෙන විශේෂත්වය ..ඒ තමයි එක page එකක ඉදලා තවත් page එකකට යද්දි url එකට අදාලව component වෙනස් වීමක් පමණයි වෙන්නේ..මුලු page එකම refresh වීමක් වෙන්නෑ…ඔන්න ඔය නිසා අපිට පුලුවන් අපේ app එකේ efficiency එක වැඩි කර ගන්න..ඔන්න ඕක තමයි Angular frame work එකේ තියන ප්‍රධානම විශේෂත්වය..හරි එහෙනන්  Angular ගැන පොඩි හෝ idea එකක් ගන්න ඇති කියලා හිතනවා..අපි දැන් බලමු Angular කොහොමද install කරගන්නේ කියලා..</p>



<p>මේ සදහා අපිට මුලින්ම nodejs සහ npm ( Node Package Manager  ) install කර ගන්න වෙනවා..සාමානයයෙන් nodejs intall කරනකොට npm auto ම install වෙනවා..පහල තියන url එකෙන් ගිහින් ඔයාගේ machine එකට අදාල nodejs version එක <a href="https://nodejs.org/en/">download</a> කරලා install කර ගන්න පුලුවන්..</p>



<figure class="wp-block-image"><img src="https://danushka96.github.io/sigma/wp-content/uploads/2019/01/cap4-1024x502.jpg" alt="" class="wp-image-1554" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2019/01/cap4-1024x502.jpg 1024w, https://danushka96.github.io/sigma/wp-content/uploads/2019/01/cap4-300x147.jpg 300w, https://danushka96.github.io/sigma/wp-content/uploads/2019/01/cap4-768x377.jpg 768w, https://danushka96.github.io/sigma/wp-content/uploads/2019/01/cap4.jpg 1350w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>ඔන්න ඔය විදියට install කර ගත්ත nodejs version එක අපිට බලන්න පුලුවන් command prompt එකේ ng -v ලෙස type කරලා..npm -v ලෙස type කරලා npm version එක බලන්න පුලුවන්.ඔන්න ඔය ටික තමයි prerequisites වෙන්නේ Angular සමග වැඩ කරද්දි.</p>



<p>ඔන්න ඔය prerequisites satisfy කලාම අපිට පුලුවන් අලුත් Angular project එකක් start කරන්න.මේ සදහා ng new &lt;project_name&gt; කියන command එක පාවිච්චි කරන්න පුලුවන්..හරි මම Desktop එකේ අලුත් project එකක් හදනවා angular කියලා..ඊට අදාල command ටික මෙන්න මේ විදියට run කරන්න පුලුවන්..</p>



<ul class="wp-block-gallery columns-1 is-cropped"><li class="blocks-gallery-item"><figure><img src="https://danushka96.github.io/sigma/wp-content/uploads/2019/01/Capture1-1-1024x102.jpg" alt="" data-id="1566" data-link="https://danushka96.github.io/sigma/?attachment_id=1566" class="wp-image-1566" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2019/01/Capture1-1-1024x102.jpg 1024w, https://danushka96.github.io/sigma/wp-content/uploads/2019/01/Capture1-1-300x30.jpg 300w, https://danushka96.github.io/sigma/wp-content/uploads/2019/01/Capture1-1-768x76.jpg 768w, https://danushka96.github.io/sigma/wp-content/uploads/2019/01/Capture1-1.jpg 1366w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure></li></ul>



<p>ඊටපස්සේ මෙන්න මේ වගේ files ගොඩක් Download වෙනවා..</p>



<ul class="wp-block-gallery columns-1 is-cropped"><li class="blocks-gallery-item"><figure><img src="https://danushka96.github.io/sigma/wp-content/uploads/2019/01/cap2-2-1024x492.jpg" alt="" data-id="1568" data-link="https://danushka96.github.io/sigma/?attachment_id=1568" class="wp-image-1568" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2019/01/cap2-2-1024x492.jpg 1024w, https://danushka96.github.io/sigma/wp-content/uploads/2019/01/cap2-2-300x144.jpg 300w, https://danushka96.github.io/sigma/wp-content/uploads/2019/01/cap2-2-768x369.jpg 768w, https://danushka96.github.io/sigma/wp-content/uploads/2019/01/cap2-2.jpg 1366w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure></li></ul>



<figure class="wp-block-image"><img src="https://danushka96.github.io/sigma/wp-content/uploads/2019/01/cap3-1-1024x255.jpg" alt="" class="wp-image-1569" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2019/01/cap3-1-1024x255.jpg 1024w, https://danushka96.github.io/sigma/wp-content/uploads/2019/01/cap3-1-300x75.jpg 300w, https://danushka96.github.io/sigma/wp-content/uploads/2019/01/cap3-1-768x191.jpg 768w, https://danushka96.github.io/sigma/wp-content/uploads/2019/01/cap3-1.jpg 1366w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>හරි එහෙනම් අපි දැන් අලුත් project එකක් start කලා angular කියලා..අපි දැන් බලමු හදා ගත්ත project එක run කරන්නේ කොහොමද කියලා..ගොඩක් frame work වල වගේම Angular වලත් තියනවා එයාටම කියලා server එකක්..project එක run කරනවානම් මුලින්ම අපි ng serve හරි npm start හරි ගහලා server එක start කරගෙන ඉන්න ඕනි.ඊට පස්සේ ng -open හරි ng -o හරි ගැහුවහම automatically ඔයාලගේ browser එකේ localhost:4200 කියන port එකේ app එක run වෙනවා..ඔන්න ඔය විදියට app එක run කලාම මෙන්න මේ වගේ view එකක් අපිට බලා ගන්න පුලුවන්.</p>



<ul class="wp-block-gallery columns-1 is-cropped"><li class="blocks-gallery-item"><figure><img src="https://danushka96.github.io/sigma/wp-content/uploads/2019/01/a-1024x462.jpg" alt="" data-id="1573" data-link="https://danushka96.github.io/sigma/?attachment_id=1573" class="wp-image-1573" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2019/01/a-1024x462.jpg 1024w, https://danushka96.github.io/sigma/wp-content/uploads/2019/01/a-300x135.jpg 300w, https://danushka96.github.io/sigma/wp-content/uploads/2019/01/a-768x347.jpg 768w, https://danushka96.github.io/sigma/wp-content/uploads/2019/01/a.jpg 1351w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure></li></ul>



<p>හරි අදට ඇති නේද😃..පාඩම නම් ටිකක් දිග වුනා තමයි , නමුත් අපි දැන ගත්තා මොකද්ද Angular කියන්නේ, ඇයි Angular විශේෂ වෙනේ ,කොහාමද Angular project එකක් හදා ගන්නේ හා කොහොමද හදා ගත්ත Angular project එක run කරන්නේ කියන එක ගැන..මීලඟ පාඩමේදී අපි බලමු Angular වල folder structure එක සහ index page එක කොහොමද render වුනේ කියන එක ගැන…අදට පාඩම හමාර කරන්නයි යන්නේ..post එක ගැන ඔයාලගේ අදහස comment එකක් දාන්නත් අමතක කරන්න එපා..මීලඟ පාඩමෙන් හමුවනතුරු ඔබට සුභ දවසක්!😊</p>
<p>The post <a rel="nofollow" href="https://danushka96.github.io/sigma/index.php/2019/01/16/angular7/">Angular7 මුල සිට ඉගෙන ගනිමු-1 කොටස</a> appeared first on <a rel="nofollow" href="https://danushka96.github.io/sigma/">The SIGMA</a>.</p>
]]></content:encoded>
							<wfw:commentRss>https://danushka96.github.io/sigma/index.php/2019/01/16/angular7/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
							</item>
		<item>
		<title>MEAN Part 2 (Mongo DB)</title>
		<link>https://danushka96.github.io/sigma/index.php/2018/09/24/mean-part-2-mongo-db/</link>
				<comments>https://danushka96.github.io/sigma/index.php/2018/09/24/mean-part-2-mongo-db/#comments</comments>
				<pubDate>Mon, 24 Sep 2018 17:42:48 +0000</pubDate>
		<dc:creator><![CDATA[Sandun Prasanganath]]></dc:creator>
				<category><![CDATA[mean stack]]></category>
		<category><![CDATA[angular.js]]></category>
		<category><![CDATA[express]]></category>
		<category><![CDATA[mongo DB]]></category>
		<category><![CDATA[node.js]]></category>

		<guid isPermaLink="false">https://danushka96.github.io/sigma/?p=1369</guid>
				<description><![CDATA[<p><span class="rt-reading-time" style="display: block;"><span class="rt-label">Reading Time: </span> <span class="rt-time">4</span> <span class="rt-label rt-postfix">minutes</span></span> හැමෝටම ආයුබෝවන්!!පසුගිය ලිපියෙන් මම mongo DB  install කරගෙන ඒකෙ mongo server එක​ on කරගන්න විදිය කියල දුන්නා.ඉතින් මේ ලිපියේදී මම ඒ on කරගත්ත server එකේ වැඩ කරන්නේ කොහොමද කියල කියල දෙන්නම්.කව්‍ රුහරි අද අපිත් එක්ක මුලින්ම​ එකතු වෙනවනම් මෙතනින් ගිහින් ඒ ලිපිය බලන්න පුලුවන්. Database Commands ඉතින් මෙහෙම mongo DB server<a class="moretag" href="https://danushka96.github.io/sigma/index.php/2018/09/24/mean-part-2-mongo-db/"> Read more&#8230;</a></p>
<p>The post <a rel="nofollow" href="https://danushka96.github.io/sigma/index.php/2018/09/24/mean-part-2-mongo-db/">MEAN Part 2 (Mongo DB)</a> appeared first on <a rel="nofollow" href="https://danushka96.github.io/sigma/">The SIGMA</a>.</p>
]]></description>
								<content:encoded><![CDATA[<p><span class="rt-reading-time" style="display: block;"><span class="rt-label">Reading Time: </span> <span class="rt-time">4</span> <span class="rt-label rt-postfix">minutes</span></span>හැමෝටම ආයුබෝවන්!!පසුගිය ලිපියෙන් මම mongo DB  install කරගෙන ඒකෙ mongo server එක​ on කරගන්න විදිය කියල දුන්නා.ඉතින් මේ ලිපියේදී මම ඒ on කරගත්ත server එකේ වැඩ කරන්නේ කොහොමද කියල කියල දෙන්නම්.කව්‍ රුහරි අද අපිත් එක්ක මුලින්ම​ එකතු වෙනවනම් <a href="https://danushka96.github.io/sigma/index.php/2018/09/22/mean-part-1/">මෙතනින්</a> ගිහින් ඒ ලිපිය බලන්න පුලුවන්.</p>
<h3><strong>Database Commands</strong></h3>
<p>ඉතින් මෙහෙම mongo DB server එක on කරගත්තට පස්සේ අලුත් console එකක් open කරගෙන <strong>mongo</strong> කියල type කරන්න එතකොට ඔයාට ඔයගේ තියෙන mongo DB version එක මොකක්ද කියල  බලාගන්න පුලුවන්,ඒ console එකේ තමයි අපි command කරන්නේ.</p>
<p><img src="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/p1.png" alt="" width="699" height="183" class=" wp-image-1373 aligncenter" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/p1.png 977w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/p1-300x79.png 300w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/p1-768x201.png 768w" sizes="(max-width: 699px) 100vw, 699px" /></p>
<p>දැනට තියෙන database මොනවද කියලා බලාගන්නා ඕනිනම් <strong>show dbs</strong> කියලා type කරන්න​.එතකොට දැනට තියෙන database ටික මෙන්න මේ විදියට පෙන්නනවා.</p>
<p><img src="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/p2.png" alt="" width="704" height="164" class="wp-image-1375 aligncenter" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/p2.png 959w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/p2-300x70.png 300w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/p2-768x179.png 768w" sizes="(max-width: 704px) 100vw, 704px" /></p>
<p>config කියල තියෙන්නෙ මම හදපු database එකක්.අපි බලමු mongo DB වල අලුතින් database එකක් හදාගන්නේ කොහොමද කියලා.mysql වල නම් create database ගැහුවම database එක හැදෙනවා,හැබැයි ඒ database එක ඇතුලට යන්න අපිට ආයිමත් use databse කියල type කරන්න වෙනවා,mongo වල එහෙම ඕනි වෙන්නේ නැ,use කියල ගහලා database එකේ නම ගැහුවහම database එක create වෙලා auto ම switch වෙනවා.</p>
<p>දැන් මම customer කියලා database එකක් හදන හැටි පෙන්වන්නම්.</p>
<p><img src="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/p4.png" alt="" width="553" height="284" class="size-full wp-image-1378 aligncenter" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/p4.png 553w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/p4-300x154.png 300w" sizes="(max-width: 553px) 100vw, 553px" /></p>
<p>මම හිතනවා දැන් ඔයලට පැහැදිලි වෙන්න ඇති කියලා.දැන් මම කියලා දෙන්නම් mongo වල data save වෙන්නේ කොහොමද කියලා,මම කලින් ලිපියේ කිව්වා document එහෙම නැත්තම් json syntax (java script object) විදියට තමයි මේ data save වෙන්නේ කියලා.මම පෙන්වන්නම් කොහොමද ඒක කරන්නේ කියලා.</p>
<p><strong>1.අපිට පුලුවන් key එකයි value එකයි විදියට data insert කරන්න​.</strong></p>
<p><img src="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/p9.png" alt="" width="550" height="144" class="size-full wp-image-1381 aligncenter" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/p9.png 550w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/p9-300x79.png 300w" sizes="(max-width: 550px) 100vw, 550px" /></p>
<p>&nbsp;</p>
<p><strong>2.Array එකක් විදියට insert කරන්න </strong></p>
<p><img src="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/p10.png" alt="" width="563" height="142" class="size-full wp-image-1380 aligncenter" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/p10.png 563w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/p10-300x76.png 300w" sizes="(max-width: 563px) 100vw, 563px" /></p>
<p>&nbsp;</p>
<p><strong>3.object එකක් විදියට insert කරන්න</strong></p>
<p><img src="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/p12.png" alt="" width="571" height="140" class="size-full wp-image-1382 aligncenter" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/p12.png 571w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/p12-300x74.png 300w" sizes="(max-width: 571px) 100vw, 571px" /></p>
<p>&nbsp;</p>
<p><strong>4.Array object එකක් විදියට insert කරන්න</strong></p>
<p><img src="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/p13.png" alt="" width="573" height="148" class="size-full wp-image-1383 aligncenter" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/p13.png 573w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/p13-300x77.png 300w" sizes="(max-width: 573px) 100vw, 573px" /></p>
<p>ඉතින් මම මේ ඔයාලට පැහැදිලි කලේ mongo  වල​ data insert කරන්න පුලුවන් විදි නැත්තම් ආකාර​ ගැනයි.</p>
<p>දැන් අපි බලමු අපි හදාගත්ත customer database එක ඇතුලේ table එකක්  හදාගෙන ඒකට data <strong>insert</strong> කරන්නේ කොහොමද කියලා,table එක හදගන්න කලින් බලන්න database එක හරියට switch වෙලා තියෙනවද කියලා.එකේ error එකක් නැතිනම් මෙන්න මේ <strong>db.createCollection(&#8216;table name&#8217;)</strong>  command  එක type  කරලා අලුතින් table එකක් ඒ කියන්නේ collection එකක් හදාගන්න.</p>
<p><em>(මේ හැම දේකදිම mongo  server එක on වෙලා mongo shell  එකක් open වෙලා තියෙන්න ඕනි)​</em></p>
<p><img src="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/a5-1.png" alt="" width="420" height="315" class=" wp-image-1389 aligncenter" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/a5-1.png 572w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/a5-1-300x225.png 300w" sizes="(max-width: 420px) 100vw, 420px" /></p>
<p>ඉතින් මේ collection එක හරියට generate වුනාද කියලා <strong>show collections</strong> command එක type කරලා ඔයාලට බලන්න පුලුවන්.<img src="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/a6.png" alt="" width="446" height="316" class="wp-image-1390 aligncenter" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/a6.png 597w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/a6-300x213.png 300w" sizes="(max-width: 446px) 100vw, 446px" /></p>
<p>දැන් ඔයාලට පේනවා ඇති table එක හැදිලා තියෙනවා.දැන් table එකට data insert කරමු.</p>
<p>මුලින්ම <strong>db.user.insert({first:&#8221;kamal&#8221;,last:&#8221;silva&#8221;})</strong> type කරන්න​.ඊට පස්සේ ඔයාට හරියට insert වුනාද කියලා බලාගන්න ඕනිනම් <strong>db.user.find()</strong> command එක type කරන්න​.</p>
<p><img src="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/ar.png" alt="" width="541" height="237" class="wp-image-1391 aligncenter" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/ar.png 774w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/ar-300x131.png 300w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/ar-768x336.png 768w" sizes="(max-width: 541px) 100vw, 541px" /></p>
<p>මොකක්ද මේ <em><strong>ObjectId</strong></em> එක කියන්නේ,my sql වල නම්  table එකක් හදනකොට අපි id කියලා field එකක් හදලා ඒක Auto Increment දෙනවා අපේ primary key එක විදියට​,mongo වල එහෙම ඕනි වෙන්නෙ නැ,එයාම Auto Id එකක් හදගන්නවා,මම ඒක කරලම පෙන්වන්නම්.ඒකට මම තව data set එකක් enter කරන්නම්.</p>
<p><img src="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/aq.png" alt="" width="644" height="266" class=" wp-image-1392 aligncenter" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/aq.png 870w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/aq-300x124.png 300w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/aq-768x317.png 768w" sizes="(max-width: 644px) 100vw, 644px" /></p>
<p>දැන් ඔයලට පේනවා ඇති ObjectId එක auto  හදාගන්නවා කියල.මේකෙදි මම තව දෙයක් කලා.ඒ තමයි table එකට තව feild එකක් add කරපු එක,මේකට තමයි scaling කියලා කියන්නේ,ඒ කියන්නේ අතරමැදදී අපේ table එකට අලුතින් feilds add කරගන්න පුලුවන් කියන එකයි.ඒකත් මේ mongo DB වල විශේශ දෙයක්.</p>
<p><strong>db.user.find().pretty()</strong> command එක type කරල බලන්නකෝ,එතකොට insert කරපු data ටික වඩා පැහැදිලිව බලාගන්න පුලුවන්.</p>
<p>insert කරන එක දැනට නවත්තලා table එකක් <strong>update</strong> කරන්නෙ කොහොමද කියලා දැන් බලමු.</p>
<p>මේකට මම කලින් insert කරපු data set එකම යොදා ගන්නම්.<strong>db.user.update({match},{update data set}) </strong>මේක තමයි command එක,​</p>
<p>මෙහෙම කිව්වට සමහරවිට ඔයාලට තේරුනේ නැතිව ඇති,මම ඒක පැහැදිලි කරන්නම්.මම පලවෙනිපාර insert කරපු data set එකේ town කියලා feild එකක් තිබ්බේ නැ,මම ඒක අලුතින් update කරලා පෙන්වන්නම්.</p>
<p><strong>db.user.update({first:&#8221;kamal&#8221;},{first:&#8221;kamal&#8221;,last:&#8221;silva&#8221;,town:&#8221;gampaha&#8221;})  </strong>command එක​ type කරලා enter<strong> කරන්න​.ඊට පස්සෙ db.user.find().pretty()</strong> type කරන්න​.දැන් ඔයාලට පේනවා පලවෙනියට insert කරපු  data set එක update වෙලා කියලා.</p>
<p><img src="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/aqw.png" alt="" width="622" height="355" class="wp-image-1396 aligncenter" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/aqw.png 843w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/aqw-300x171.png 300w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/aqw-768x438.png 768w" sizes="(max-width: 622px) 100vw, 622px" /></p>
<p>දැන් අපි බලමු<strong> delete</strong> function එක වැඩ​ කරන්නේ කොහොමද කියලා.<strong>db.user.remove({first:&#8221;kamal&#8221;}) </strong>මෙන්න මේ command එකෙන් first name එක &#8220;kamal&#8221; වෙන සියලුම data remove වෙලා යනවා.</p>
<p><img src="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/we-1.png" alt="" width="672" height="232" class=" wp-image-1397 aligncenter" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/we-1.png 825w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/we-1-300x104.png 300w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/we-1-768x265.png 768w" sizes="(max-width: 672px) 100vw, 672px" /></p>
<p>&nbsp;</p>
<p><em>ඉතින් අද අපි කතා කලේ මේ insert,delete,update function වලට අදාලවන මූලිකම කරුණු ටිකක්, මගේ ඊලග ලිපියෙන් මේ function කෙටියෙන් කරන්නේ කොහොමද​, ඒ වගේම එක සමාන data set එකක් තිබුනහම මේ function වැඩ කරන්නේ කොහොමද කියලා පැහැදිලි කරන්නම්.</em></p>
<p>&nbsp;</p>
<p>The post <a rel="nofollow" href="https://danushka96.github.io/sigma/index.php/2018/09/24/mean-part-2-mongo-db/">MEAN Part 2 (Mongo DB)</a> appeared first on <a rel="nofollow" href="https://danushka96.github.io/sigma/">The SIGMA</a>.</p>
]]></content:encoded>
							<wfw:commentRss>https://danushka96.github.io/sigma/index.php/2018/09/24/mean-part-2-mongo-db/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
							</item>
		<item>
		<title>MEAN Part 1 (Mongo DB)</title>
		<link>https://danushka96.github.io/sigma/index.php/2018/09/22/mean-part-1/</link>
				<comments>https://danushka96.github.io/sigma/index.php/2018/09/22/mean-part-1/#comments</comments>
				<pubDate>Sat, 22 Sep 2018 11:33:09 +0000</pubDate>
		<dc:creator><![CDATA[Sandun Prasanganath]]></dc:creator>
				<category><![CDATA[mean stack]]></category>
		<category><![CDATA[angular.js]]></category>
		<category><![CDATA[express]]></category>
		<category><![CDATA[mongo DB]]></category>
		<category><![CDATA[node.js]]></category>

		<guid isPermaLink="false">https://danushka96.github.io/sigma/?p=1334</guid>
				<description><![CDATA[<p><span class="rt-reading-time" style="display: block;"><span class="rt-label">Reading Time: </span> <span class="rt-time">3</span> <span class="rt-label rt-postfix">minutes</span></span> web development වලට අදාලව එන platform 4 ක් එකට​ එකතු උන තැනක් තමයි මේ MEAN කියලා කියන්නේ.ඉතින් මෙම ලිපියේ සිට ඉදිරියට MEAN web development කියන්නේ මොකක්ද​,එකෙන් කරන්න පුලුවන් මොනාද කියල මම පැහැදිලි කරන්නම්. &#160; &#160; web development application එකක​ front end එක ඒ කියන්නේ client side කොටස​ වගේම backend එක  ඒ කියන්නේ server side කොටස<a class="moretag" href="https://danushka96.github.io/sigma/index.php/2018/09/22/mean-part-1/"> Read more&#8230;</a></p>
<p>The post <a rel="nofollow" href="https://danushka96.github.io/sigma/index.php/2018/09/22/mean-part-1/">MEAN Part 1 (Mongo DB)</a> appeared first on <a rel="nofollow" href="https://danushka96.github.io/sigma/">The SIGMA</a>.</p>
]]></description>
								<content:encoded><![CDATA[<p><span class="rt-reading-time" style="display: block;"><span class="rt-label">Reading Time: </span> <span class="rt-time">3</span> <span class="rt-label rt-postfix">minutes</span></span>web development වලට අදාලව එන platform 4 ක් එකට​ එකතු උන තැනක් තමයි මේ <strong>MEAN</strong> කියලා කියන්නේ.ඉතින් මෙම ලිපියේ සිට ඉදිරියට MEAN web development කියන්නේ මොකක්ද​,එකෙන් කරන්න පුලුවන් මොනාද කියල මම පැහැදිලි කරන්නම්.</p>
<p>&nbsp;</p>
<p><img src="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/Benefits-Of-Using-Mean-Stack-For-Application-Development-300x190.jpg" alt="" width="375" height="238" class=" wp-image-1336 aligncenter" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/Benefits-Of-Using-Mean-Stack-For-Application-Development-300x190.jpg 300w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/Benefits-Of-Using-Mean-Stack-For-Application-Development-768x487.jpg 768w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/Benefits-Of-Using-Mean-Stack-For-Application-Development.jpg 846w" sizes="(max-width: 375px) 100vw, 375px" /></p>
<p>&nbsp;</p>
<p>web development application එකක​ front end එක ඒ කියන්නේ client side කොටස​ වගේම backend එක  ඒ කියන්නේ server side කොටස නිර්මණය කිරීමට විවිධ platform තියෙනවා. ඉතින් Mean වල,</p>
<p>&nbsp;</p>
<p><strong>data base system-&gt;<em>M</em>ongo DB</strong></p>
<p><strong>back end web framework-&gt;<em>E</em>xpress</strong></p>
<p><strong>front end framework-&gt;<em>A</em>njular.js</strong></p>
<p><strong>back end run time environment-&gt;<em>N</em>ode.js</strong></p>
<p>ඉතින් මොනාද මේ platform ඒවයින් කොහොමද වැඩ කරන්නේ කියල මම මෙතැන් සිට ඉදිරියට පැහැදිලි කරන්නම්.</p>
<p>මුලින්ම මම MEAN STACK වලට අදාලව database system එක  වන <strong>Mongo DB</strong> ගැන පැහැදිලි කරන්නම්.</p>
<h3><strong>Mongo DB</strong></h3>
<p>&nbsp;</p>
<p><img src="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/we-300x150.png" alt="" width="322" height="161" class=" wp-image-1340 aligncenter" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/we-300x150.png 300w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/we.png 318w" sizes="(max-width: 322px) 100vw, 322px" /></p>
<p>මෙහිදී මම කොහොමද Mongo DB අපේ computer එකට​ install කරගන්නේ,කොහොමද Mongo DB වලින් insert,delete,update වගේ Fundamental කරන්නේ වගේම mongoose ගැනත් පොඩ්ඩක් කතාකරන්න බලපොරොත්තු වෙනවා.</p>
<p>Mongo DB කියල කියන්නේ No Sql ගනයට වැටෙන database එකක්.ඉතින් එතනම අදහස පැහැදිලි වෙනවනෙ.අපි සාමාන්‍යයන් පාවිච්චි කරන්නේ Relational Database,  මේවට​ හොදම උදහරණයක් නෙ My Sql කියල කියන්නේ.ඉතින් මේ Relational Database වලට වඩා advance data base එකක් තමයි no sql database කියල කියන්නේ.</p>
<p>Mongo DB වල තියෙන විශේෂත්වය තමයි document නැත්තම් json syntax විදියට තමයි data store කරගන්නේ.</p>
<p><em>(මේ json syntax කියන්නේ මොකක්ද කියල මම ඉදිරියට පැහැදිලි කරන්නම්)</em></p>
<p>Relational Data Base එකක අපිට මුලු database එකම map කරන්න වෙනවා.ඒ කියන්නේ අපි database එකක් හදනකොට අපිට එකේ fields,data types,tables ඔක්කොම හදන්න වෙනවා.කොටින්ම කිව්වොත් structure එකක් තියගන්න වෙනවා.හැබැයි mongo DB වල එහෙම ඕනි වෙන්නේ නැ.අපිට කෙලින්ම scale එකක් තියගන්න පුලුවන්.එක මේ no sql වල තියෙන ප්‍රධාන වාසියක්.</p>
<p>ඉතින් අපි data විශාල ප්‍රමාණයක් handle කරනවනම් වඩා හොද database system එක තමයි Mongo DB ,මේ data base වල තියෙන තව වාසියක් තමයි speed එක  Relational Database වලට වඩා වැඩි වීම​.</p>
<p>ඉතින් මම හිතනවා mongo DB ගැන පොඩි අදහසක් ගන්න ඇති කියල මේ පැහැදිලි කිරීමත් එක්ක​,</p>
<p>අපි ඊලගට බලමු කොහොමද මේ Mongo DB, computer එකට install කරගන්නේ කොහොමද​ කියලා.</p>
<p>mongo DB site<a href="http://www.mongodb.com/"><strong>(www.mongodb.com)</strong></a> එකට ගිහින් download කරන ආකාරය මම පියවර අකාරයෙන් දක්වන්නම්.</p>
<p>&nbsp;</p>
<h5><strong>පියවර 1:</strong></h5>
<p><img src="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/12-1.png" alt="" width="796" height="555" class="alignnone size-full wp-image-1347" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/12-1.png 796w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/12-1-300x209.png 300w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/12-1-768x535.png 768w" sizes="(max-width: 796px) 100vw, 796px" /></p>
<p>&nbsp;</p>
<h5><strong>පියවර 2:</strong></h5>
<p><img src="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/15.png" alt="" width="793" height="531" class="alignnone size-full wp-image-1349" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/15.png 793w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/15-300x201.png 300w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/15-768x514.png 768w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/15-360x240.png 360w" sizes="(max-width: 793px) 100vw, 793px" /></p>
<h5><strong>පියවර​ 3:</strong></h5>
<p><img src="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/14.png" alt="" width="789" height="460" class="alignnone size-full wp-image-1350" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/14.png 789w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/14-300x175.png 300w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/14-768x448.png 768w" sizes="(max-width: 789px) 100vw, 789px" /></p>
<p>ඉතින් මම​ හිතනවා මම පැහැදිලි කරනවට වඩා මේ පියවර ටික බලලා ඔයලා තේරුම් ගන්න ඇති කියල කොහොමද mongo DB install කරන්නේ කියලා.</p>
<p>3 වෙනි පියවරේ platform එකට අදාලව​ msi file එක download කලාට පස්සේ ඒක open කරලා install කරන්න.mongo DB run කරන්න computer එකේ නිකන්ම install විතරක් කරල මදි,ඒකට variable path එක හදගන්න ඕනි.මම පැහැදිලි කරන්නම් කොහොමද ඒක කරන්නේ කියලා.</p>
<p>mongo DB install කරලා තියෙන තැන (සාමාන්‍යයෙන් c drive එකේ) open කරන්න​.ඊලගට ඒකේ තියෙන බින් file එකේ path එක copy කරගෙන​ Advanced System Setting යටතේ Environment variable වල User Variable එකේ​ path එක set කරගන්න​.</p>
<p><em>(මෙහෙම මම කිව්වට ඔයලට සමහරවිට තේරුණේ නැතිව ඇති,මම පෙන්වන්නම් කොහොමද path එක set කරගන්නේ කියලා)</em></p>
<p><img src="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/a1.png" alt="" width="409" height="265" class="wp-image-1353 aligncenter" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/a1.png 622w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/a1-300x194.png 300w" sizes="(max-width: 409px) 100vw, 409px" /></p>
<p>&nbsp;</p>
<p><img src="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/a2.png" alt="" width="472" height="211" class="wp-image-1354 aligncenter" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/a2.png 611w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/a2-300x134.png 300w" sizes="(max-width: 472px) 100vw, 472px" /></p>
<p>&nbsp;</p>
<p><img src="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/a3.png" alt="" width="566" height="335" class="wp-image-1355 aligncenter" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/a3.png 665w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/a3-300x177.png 300w" sizes="(max-width: 566px) 100vw, 566px" /></p>
<p>&nbsp;</p>
<p><img src="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/a4.png" alt="" width="325" height="364" class=" wp-image-1356 aligncenter" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/a4.png 421w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/a4-268x300.png 268w" sizes="(max-width: 325px) 100vw, 325px" /></p>
<p>&nbsp;</p>
<p><img src="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/a5.png" alt="" width="516" height="336" class=" wp-image-1357 aligncenter" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/a5.png 591w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/a5-300x195.png 300w" sizes="(max-width: 516px) 100vw, 516px" /></p>
<p>&nbsp;</p>
<p>ඉතින් මෙහෙම install කරල ඉවර වෙලා ඔයාගෙ cmd එක open කරල <strong>mongod</strong> කියල type කරන්න​.හරියට install උනානම් මෙන්න මෙහෙම details ටිකක් එන්න ඕනි.</p>
<p><img src="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/23.png" alt="" width="740" height="261" class="wp-image-1358 aligncenter" srcset="https://danushka96.github.io/sigma/wp-content/uploads/2018/09/23.png 956w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/23-300x106.png 300w, https://danushka96.github.io/sigma/wp-content/uploads/2018/09/23-768x271.png 768w" sizes="(max-width: 740px) 100vw, 740px" /></p>
<p>&nbsp;</p>
<p>mongod කියල command එක run කරලා අපි කරන්නෙ <strong><em>mongo DB server</em></strong> එක <em><strong>on</strong></em> කරන එකයි.</p>
<p>mongo DB  වල insert,delete,update කරන්නේ කොහොමද කියල කියන්න ඕනි වුනත් ලිපියේ මුලම mean stack ගැන විස්තර ටිකක් කතාකරපු හින්දා ලිපිය අවශය ප්‍රමනයට වඩා දිග වුනා.ඒක හින්දා ඒ කොටස මම ඊලග ලිපියෙන් කතාකරන්න බලාපොරොත්තු වෙනවා.</p>
<p>The post <a rel="nofollow" href="https://danushka96.github.io/sigma/index.php/2018/09/22/mean-part-1/">MEAN Part 1 (Mongo DB)</a> appeared first on <a rel="nofollow" href="https://danushka96.github.io/sigma/">The SIGMA</a>.</p>
]]></content:encoded>
							<wfw:commentRss>https://danushka96.github.io/sigma/index.php/2018/09/22/mean-part-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
							</item>
	</channel>
</rss>
