0.0.3 • Published 7 years ago

p2b2-connector-mongodb v0.0.3

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

MongoDB Connector

Setup of mongodb database:

Follow the installation instructions from mongodb.

Start the mongodb by executing sudo service mongod start

Then, enter the mongodb shell by typing mongo in your command line.

Create a database for the project:

use p2b2

Create a collection for the blocks to be saved in:

db.createCollection("blocks")

Note: You won't be able to see the new p2b2 database before creating the collection, because the database is completely empty.

Now that you created the collection, you should be able to see the database using show dbs and the collection using show collections.

Create an index for the block number:

db.records.createIndex({number:-1})