Posts

Mongo DB - Topics

Image
   Topics 01.Mongo DB - Introduction 02.Mongo DB - Download and install mongoDB 03.Mongo DB - Commands which we use in mongoDB. 04.Mongo DB - Mongo DB - Spring Boot Project 05.Mongo DB - Query part 1 (Create,Insert,Update,Drop,Remove,Find,limit,skip,sortAND,OR,INDEX) 06.Mongo DB - Query part 2 (Aggregation) 07.Mongo DB - Query part 3 (MongoDB Backup and Restore) 08.Mongo DB - Query part 4 (Query Example) 09.Mongo DB - ALL

GraphQL - topics

Image
  Introduction Project Creation Test with GraphiQL Test with postman

01. GraphQL - Introduction

Image
  Guiding Tutorial -   01.Channel : https://www.youtube.com/@DanVega   Video: https://www.youtube.com/watch?v=TVk2fMEezO4&list=RDCMUCc98QQw1D-y38wg6mO3w4MQ&index=3&ab_channel=DanVega   https://www.howtographql.com/basics/0-introduction/   GraphQL යනු , GraphQL යනු REST,SOAP වැනි API ලියන තවත් එක් technique එකක් වන අතර මෙහි ඇති විශේෂත්වය වනුයේ single end point එකක් හරහා multiple consumers ලට dynamically ව ඔහුන්ට අවශ්‍ය data පමණක් access කර ගන්න පුළුවන් විදිහට මෙම API ලියන එකයි. Rest හෝ SOAP වලිදී end point ගොඩක් ලියනවා වෙනුවට GraphQL වලදී single end point එකකින් මේකේ වැඩේ කර ගත හැක.   Ex: There is an API end point which prove a Student Object based on given ID. Student [ID, StudentFirstName, StudentLastName, Age]   Consumer 01 : I want full student object. Consumer 02 : I want only student first name and age. Consumer 03 : I want only student last name.   Rest or SOAP වලදී නම් එක්කෝ end po...

02. GraphQL - Project Creation

Image
Created project GitHub Link - https://github.com/LahiruPriyankara/graphQL   Create spring boot project by adding bellow dependencies. application.property server.port =2020 spring.datasource.driver-class-name =com.mysql.cj.jdbc.Driver spring.datasource.url =jdbc:mysql://localhost:3306/graphql? createDatabaseIfNotExist =true spring.datasource.username =root spring.datasource.password =root #spring.jpa.show-sql=true spring.jpa.hibernate.ddl-auto =create spring.jpa.properties.hibernate.dialect =org.hibernate.dialect.MySQL8Dialect spring.graphql.graphiql.enabled =true spring.graphql.schema.printer.enabled =true #spring.graphql.cors.allowed-origins=* schema.graphqls type Student {     id: ID!     firstName: String     lastName: String     age: Int     gender: Gender     studentClass: StudentClass }   enum Gender{     MALE,     FEMALE }   type StudentClass { ...

03. GraphQL - Test with GraphiQL

Image
  Test Application   Run the application You can test GraphQL application using UI or Postman( or similar IDE). 01. Using UI   Hit on browser. -  http://localhost:2020/graphiql?path=/graphql 01. Getting all Student (Without pagination) query{   allStudent{     id     firstName     lastName     age     studentClass{       id       grade       teacherName     }   } } 02. Getting a specific Student query{   findStudent(id:4){     id     firstName     lastName     age     studentClass{       id       grade       teacherName    ...

04. GraphQL - Test with postman

Image
  Postman Collection GitHub Url - https://github.com/LahiruPriyankara/graphQL Test using Postman

01.Mongo DB - Introduction

Image
  Mongo DB Mongo DB  යනු  noSql open source database  එකක්   වේ . SQL database  හෙවත්  relational database  වලදී  data table  වල   තබා   ගන්න   අතර   මෙම  table table  අතර  relationship  ද   පවතී . නමුත්  mongoDB  වලදී  data  පවතිනුයේ  document collection  එකක්   ලෙසට   වන   අතර   මෙම  documents  අතර  relations  නැත . එනම්  documents are not related with each other.  Schema free  වන   අතර  this is based on binary JSON  එනම්  BSON. Mongo DB simple query language  එක   ලෙස  simple query language  එක   බාවිතා   කරනු   ලබයි  (SQL  වගේ ).  SQL and MongoDB Comparison. Table – Collection Row – Document Column – File Collection is not strict about what goes in it (it’s schema-less).