<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ca">
	<id>http://wiki.joanillo.org/index.php?action=history&amp;feed=atom&amp;title=CRUD_amb_Node%2C_Express_i_MongoDB</id>
	<title>CRUD amb Node, Express i MongoDB - Historial de revisió</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.joanillo.org/index.php?action=history&amp;feed=atom&amp;title=CRUD_amb_Node%2C_Express_i_MongoDB"/>
	<link rel="alternate" type="text/html" href="http://wiki.joanillo.org/index.php?title=CRUD_amb_Node,_Express_i_MongoDB&amp;action=history"/>
	<updated>2026-08-30T08:16:14Z</updated>
	<subtitle>Historial de revisió per a aquesta pàgina del wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>http://wiki.joanillo.org/index.php?title=CRUD_amb_Node,_Express_i_MongoDB&amp;diff=299029&amp;oldid=prev</id>
		<title>Joan: /* Introducció */</title>
		<link rel="alternate" type="text/html" href="http://wiki.joanillo.org/index.php?title=CRUD_amb_Node,_Express_i_MongoDB&amp;diff=299029&amp;oldid=prev"/>
		<updated>2022-05-06T12:11:51Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Introducció&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ca&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Versió més antiga&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revisió del 12:11, 6 maig 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Línia 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línia 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;__TOC__&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;__TOC__&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Introducció=&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Introducció=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;'''NOTA''': això no és una API Rest per fer el CRUD.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Hem seguit aquest tutorial i ha funcionat:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Hem seguit aquest tutorial i ha funcionat:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*https://zellwk.com/blog/crud-express-mongodb/&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*https://zellwk.com/blog/crud-express-mongodb/&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l47&quot; &gt;Línia 47:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línia 49:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{ &amp;quot;_id&amp;quot; : ObjectId(&amp;quot;6088266a1e4551170bd1d7e0&amp;quot;), &amp;quot;name&amp;quot; : &amp;quot;Yoda&amp;quot;, &amp;quot;quote&amp;quot; : &amp;quot;dfdsfs&amp;quot; }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{ &amp;quot;_id&amp;quot; : ObjectId(&amp;quot;6088266a1e4551170bd1d7e0&amp;quot;), &amp;quot;name&amp;quot; : &amp;quot;Yoda&amp;quot;, &amp;quot;quote&amp;quot; : &amp;quot;dfdsfs&amp;quot; }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Conclusions=&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Conclusions=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Es segueix bé l'article. Al final de l'article pots descarregar tot el codi font, i li han posat una capa d'estil més bonica.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Es segueix bé l'article. Al final de l'article pots descarregar tot el codi font, i li han posat una capa d'estil més bonica.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Autor}}, abril 2021&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Autor}}, abril 2021&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Joan</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.joanillo.org/index.php?title=CRUD_amb_Node,_Express_i_MongoDB&amp;diff=297349&amp;oldid=prev</id>
		<title>Joan: Es crea la pàgina amb «__TOC__ =Introducció= Hem seguit aquest tutorial i ha funcionat: *https://zellwk.com/blog/crud-express-mongodb/  Una de les coses interessants és que hem utilitzat t...».</title>
		<link rel="alternate" type="text/html" href="http://wiki.joanillo.org/index.php?title=CRUD_amb_Node,_Express_i_MongoDB&amp;diff=297349&amp;oldid=prev"/>
		<updated>2021-04-27T15:15:10Z</updated>

		<summary type="html">&lt;p&gt;Es crea la pàgina amb «__TOC__ =Introducció= Hem seguit aquest tutorial i ha funcionat: *https://zellwk.com/blog/crud-express-mongodb/  Una de les coses interessants és que hem utilitzat t...».&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Pàgina nova&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__TOC__&lt;br /&gt;
=Introducció=&lt;br /&gt;
Hem seguit aquest tutorial i ha funcionat:&lt;br /&gt;
*https://zellwk.com/blog/crud-express-mongodb/&lt;br /&gt;
&lt;br /&gt;
Una de les coses interessants és que hem utilitzat tant la base de dades local de MongoDB, com la base de dades en el núvol de MongoDB, i que en l'article s'explica com et pots donar d'alta&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd M06_WEC_2021/UF2&lt;br /&gt;
$ mkdir crud-express-mongodb&lt;br /&gt;
$ cd crud-express-mongodb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(...)&lt;br /&gt;
Ens donem d'alta a '''MongoDB Atlas''' (joanqc@... / S*******)&lt;br /&gt;
&lt;br /&gt;
Es crea un Project i un Cluster. Per tema de seguretat, hem de dir quina és la IP local amb què estem treballant. I finalment tinc un usuari (i pwd) per connctar-me a la bd. (joan/keiL2lai)&lt;br /&gt;
&lt;br /&gt;
Ens podem connectar a MongoDB localment o al núvol (Atlas). És bo fer-ho de les dues maneres.&lt;br /&gt;
&lt;br /&gt;
Localment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
connectionString = &amp;quot;mongodb://localhost:27017&amp;quot;&lt;br /&gt;
connectionString = &amp;quot;mongodb+srv://joan:&amp;lt;password&amp;gt;@cluster0.m3dbw.mongodb.net/myFirstDatabase?retryWrites=true&amp;amp;w=majority&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
i ara ja podem veure la primera inserció. Localment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mongo&lt;br /&gt;
MongoDB shell version v3.6.8&lt;br /&gt;
&lt;br /&gt;
&amp;gt; use star-wars-quotes&lt;br /&gt;
switched to db star-wars-quotes&lt;br /&gt;
&lt;br /&gt;
&amp;gt; db.quotes.find()&lt;br /&gt;
{ &amp;quot;_id&amp;quot; : ObjectId(&amp;quot;6087ca15364fcd37e873dccb&amp;quot;), &amp;quot;name&amp;quot; : &amp;quot;ggg&amp;quot;, &amp;quot;quote&amp;quot; : &amp;quot;hhh&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
I remotament a MongoDB Atlas:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mongo &amp;quot;mongodb+srv://cluster0.m3dbw.mongodb.net/myFirstDatabase&amp;quot; --username joan&lt;br /&gt;
MongoDB shell version v3.6.8&lt;br /&gt;
Enter password: &lt;br /&gt;
&lt;br /&gt;
MongoDB Enterprise atlas-g31xt0-shard-0:PRIMARY&amp;gt; use star-wars-quotes&lt;br /&gt;
switched to db star-wars-quotes&lt;br /&gt;
&lt;br /&gt;
MongoDB Enterprise atlas-g31xt0-shard-0:PRIMARY&amp;gt; db.quotes.find()&lt;br /&gt;
{ &amp;quot;_id&amp;quot; : ObjectId(&amp;quot;6088266a1e4551170bd1d7e0&amp;quot;), &amp;quot;name&amp;quot; : &amp;quot;Yoda&amp;quot;, &amp;quot;quote&amp;quot; : &amp;quot;dfdsfs&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=Conclusions=&lt;br /&gt;
Es segueix bé l'article. Al final de l'article pots descarregar tot el codi font, i li han posat una capa d'estil més bonica.&lt;br /&gt;
&lt;br /&gt;
{{Autor}}, abril 2021&lt;/div&gt;</summary>
		<author><name>Joan</name></author>
		
	</entry>
</feed>