Skip to content

p2b2/p2b2-connector-mongodb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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})

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published