p2b2-connector-mongodb
v0.0.3
Published
Connector to send data to from the p2b2 data extractor
Downloads
3
Readme
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})