Giter Club home page Giter Club logo

microservices-learning's Introduction

microservices-learning

learnig microservice architecture

Check if docker running

docker ps

Run image container

docker run -d -p 27017:27017 --name shopping-mongo mongo[image name]

Run/Start existing container

docker start shopping-mongo[container name]

Troubleshooting

for loggin

docker logs -f shopping-mongo[container name]

MongoDB

Open Interactive terminal for mongo db container

docker exec -it shopping-mongo mongosh

list the databases

show dbs

create database

use CatalogDB

create collections with name

db.createCollection('Products')

insert item to collection

db.Products.insert() db.Products.insertMany()

Sample insert

db.Products.insertMany([{ 'Name':'Asus Laptop','Category':'Computers', 'Summary':'Summary', 'Description':'Description', 'ImageFile':'ImageFile', 'Price':54.93 }, { 'Name':'HP Laptop','Category':'Computers', 'Summary':'Summary', 'Description':'Description', 'ImageFile':'ImageFile', 'Price':88.93 } ])

Show collections

show collections

Find all products

db.Products.find() db.Products.find().pretty()

Remove all products

db.Products.deleteOne(with brackets) db.Products.deleteMany(with brackets) db.Products.findOneAndDelete(with brackets) db.Products.bulkWrite(with brackets)

microservices-learning's People

Contributors

shhzdmrz 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.