B4J Library MongoDB - Documents database

Discussion in 'B4J Libraries & Classes' started by Erel, Oct 19, 2016.

  1. Erel

    Erel Administrator Staff Member Licensed User


    MongoDB is one of the most popular NoSQL databases.
    It is a nice and refreshing alternative to traditional relational databases (SQL databases).

    Each represented entity is stored as a single document instead of being split into multiple tables.
    Whether it will be better / simpler to use MongoDB compared to MySQL or a similar database server depends on the specific data.

    Overall it is simple to start working with MongoDB and it is definitely a good tool to add to the toolbox.

    At this point it is recommended to go over MongoDB manual: https://docs.mongodb.com/manual/introduction/

    To start with MongoDB you need to:

    1. Download and install: https://www.mongodb.com/download-center?jmp=docs
    2. Create the default data folder (can be changed): c:\data\db
    3. Run mongod from the command line.

    In most cases you will use a three tier configuration where the clients access a B4J server and the B4J server communicates with the local MongoDB server.

    I will post more examples next week. An example based on Alexa sites ranking data is available here:
    The data is loaded from a CSV file and then analyzed with different kinds of queries.

    The library is attached.
    It depends on three additional jars: www.b4x.com/b4j/files/mongodb-native.zip
    Copy the library and the jars to the additional libraries folder.

    Attached Files:

    Last edited: Oct 19, 2016
  2. clarionero

    clarionero Active Member Licensed User

    Woow, fantastic new option for B4J :)

    Thank you Erel.

  3. Erel

    Erel Administrator Staff Member Licensed User


    JOSE GOMES Member

    An CRUD example it was interesting :)
    joulongleu likes this.
  5. ShaneG30

    ShaneG30 Well-Known Member Licensed User

    After testing this out with the remote connector, I can say that this looks way easier than MySQL. I love the fact that the commands are created in the clients.
    joulongleu, magi6162 and Erel like this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice