1 min

MongoDB

http://www.mongodb.org

On Oct 6, 2014, I installed MongoDB on my Digital Ocean droplet.

It installed a 32-bit version.

https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-12-04

Created and executed a bash script with the following:

apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
echo "deb <a href="http://downloads-distro.mongodb.org/repo/ubuntu-upstart">http://downloads-distro.mongodb.org/repo/ubuntu-upstart</a> dist 10gen" | tee -a /etc/apt/sources.list.d/10gen.list
apt-get -y update
apt-get -y install mongodb-10gen

This install executed quickly and easily, as most fine things do.

It installed version 2.4.11.

The latest version available is 2.6.4, which was released on Aug 11, 2014.

Check for running process:
$ ps aux | grep mongo

Output looked similar to this:
mongodb    569  0.4  6.4 627676 15936 ?        Ssl  22:54   0:02 /usr/bin/mongod --config /etc/mongodb.conf

Perl

Perl driver for MongoDB

http://search.cpan.org/dist/MongoDB/

https://github.com/mongodb/mongo-perl-driver

On Oct 6, 2014, I executed the following command:
perl -MCPAN -e 'install MongoDB'

That installed version MongoDB-v0.705.0.0 of the Perl driver. It took 8 to 10 minutes to install the module with all of its dependencies.

It must be a big or slow module. I executed a 'hello world' script that loads the module, and the only other thing the script did was execute the print command. When loading this module, it took the script over one second to execute.

http://try.mongodb.org/

http://docs.mongodb.org/v2.2/tutorial/getting-started-with-the-mongo-shell/

To launch shell, execute:
/usr/bin/mongo

MongoDB Shell Commands

To display the database you are using, type:
> db

To switch databases, issue the use <db> command, as in the following example:
> use <database>

To list the available databases:
> show dbs

To see the list of collections in the current database:
> show collections

To see the help for methods available on the collection objects (e.g. db.<collection>), use the db.<collection>.help() method:
> db.collection.help()

http://docs.mongodb.org/manual/core/crud-introduction/

http://docs.mongodb.org/v2.2/tutorial/access-mongo-shell-help/#mongo-shell-help-collection

https://docs.nodebb.org/en/latest/configuring/databases/mongo.html

#mongodb - #datbase - #nosql

From JR's : articles
274 words - 2372 chars - 1 min read
created on
updated on - #
source - versions



A     A     A     A     A

© 2013-2017 JotHut - Online notebook

current date: Mar 29, 2024 - 9:58 a.m. EDT