== Semaine 4 17/06/2014 ==
== Mise en place d'une base mongodb ==
=== Installation ===
Téléchargement depuis le site http://www.mongodb.org/downloads
Soit la racine /u01/projets/mongodb
les binaires dans /u01/projets/mongodb/bin > <pre> bsondump mongo mongod mongodump mongoexport mongofiles mongoimport mongooplog mongoperf mongorestore mongos mongostat mongotop</pre>
Un repertoire data/db à la racine.
=== Lancement du serveur ===
<blockquotepre>/u01/projets/mongodb/bin/mongod --dbpath /u01/projets/mongodb/data/db 2014-06-17T19:05:22.147+0200 [initandlisten] MongoDB starting : pid=14868 port=27017 dbpath=/u01/projets/mongodb/data/db 64-bit host=dbi-ntbk02 2014-06-17T19:05:22.151+0200 [initandlisten] db version v2.6.2 2014-06-17T19:05:22.152+0200 [initandlisten] git version: 4d06e27876697d67348a397955b46dabb8443827 2014-06-17T19:05:22.152+0200 [initandlisten] build info: Linux build10.nj1.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49</blockquotepre>=== lancement du client ===
<blockquotepre>boizot@dbi-ntbk02:/u01/projets/mongodb/doc$ /u01/projets/mongodb/bin/mongo MongoDB shell version: 2.6.2 connecting to: test show dbs admin (empty) local 0.078GB</blockquotepre>=== Creation de la base FFH ===
<blockquote>use FFH switched to db FFH db FFH
</blockquote>
'''Initialisation de données''' > <pre> M1 = { Member_pseudo : "Pirboazo", Member_num : 123001, Langue:'fr' } { "Member_pseudo" : "Pirboazo", "Member_num" : 123001, "Langue" : "fr" }
<blockquote>M2 = { Member_pseudo : "Yv", Member_num : 3001, Langue:'fr' } { "Member_pseudo" : "Yv", "Member_num" : 3001, "Langue" : "fr" }</blockquotepre>
'''Creation de la Collection Membre''' >db.membre.insert(M1) WriteResult({ "nInserted" : 1 }) db.membre.insert(M2) WriteResult({ "nInserted" : 1 })