GithubHelp home page GithubHelp logo

genesis-spring-boot-using-mongo-db's Introduction

genesis-spring-boot-using-mongo-db

Spring Boot Microservice to serve data using REST and MongoDB

SETTING UP THE DATA BASE:

The database has already been set up on MongoDB Cloud Atlas: Steps of setting the Database:

  1. Connect to MongoDB Atlas with your CLI (details for my AWS instance can be found in details below).
  2. Create Database (megaman) with the below command:

    use megaman

  3. Create Collection bosses with the below command:

    create collection("bosses")

  4. add documents to the bosses collection:

    db.bosses.insertMany([{"name": "Man", "weapon": "Rolling Cutter", "weakness": "Super Arm" }, {"name": "Guts Man", "weapon": "Super Arm", "weakness": "Hyper Bomb" }, {"name": "Fire Man", "weapon": "Fire Wave", "weakness": "Ice Slasher" } ]); db.bosses.insertMany([{"name": "Super Siyaan", "weapon": "Rolling Cutter", "weakness": "Gohan" }, {"name": "Gohan", "weapon": "Hyper Bomb", "weakness": "Fire Wave" }, {"name": "Fire Girl", "weapon": "Fire Wave", "weakness": "Ice Slasher" } ]); db.bosses.insertMany([{"name": "Arrow", "weapon": "bow and Arrow", "weakness": "Fire Wave" }, {"name": "Aparichit", "weapon": "Dagger", "weakness": "Ambi" }, {"name": "Ambi", "weapon": "Rules and Law", "weakness": "Nandini" } ]);

  5. check the added documents via the command below:

    db.bosses.find().forEach(prinjson)

SETTING UP THE CODE_BASE:

  1. Pull the code to your local repository and import into your IDE.
  2. Do maven updated on the project.
  3. Run the spring boot project.

Instance runs on Port : 8080

API DETAILS:

Below is the list of APIs provided by the project:

Request Method ----------------------- Request Endpoint -----------------------------------
---- GET ----- http://localhost:8080/megaman/bosses/{id}
---- GET ----- http://localhost:8080/megaman/bosses/all
---- GET ----- http://localhost:8080/megaman/bosses/name/{name}
---- GET ----- http://localhost:8080/megaman/bosses/weapon/{weapon}
---- GET ----- http://localhost:8080/megaman/bosses/weakness/{weakness}
---- GET ----- http://localhost:8080/megaman/bosses/weapon/{weapon}/and/weakness/{weakness}
---- GET ----- http://localhost:8080/megaman/bosses/weapon/{weapon}/or/weakness/{weakness}
---- GET ----- http://localhost:8080/megaman/bosses/weakness/{weakness}?order=desc
---- PUT ----- http://localhost:8080/megaman/bosses/update/{name}
---- POST ---- http://localhost:8080/megaman/bosses/update/{name}
---- DELETE -- http://localhost:8080/megaman/bosses/update/{name}

MongoDB Cloud Atlas Details:

Cluster: AWS North Verginia

URI: mongodb+srv://devcluster-pybq6.mongodb.net/megaman

DB: mageman

Note- All credentials have been added in the application.properties file to support quick connection.

genesis-spring-boot-using-mongo-db's People

Contributors

shuklanishant85 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.