SlideShare a Scribd company logo
OPENSHIFT
JEE6 and NoSQL in the Cloud
Workshop

PRESENTED
BY

Shekhar
Gulati
WHO AM I?

•

Shekhar Gulati -- OpenShift Developer Evangelist

•

Java / JavaScript / Python / NoSQL / Cloud Guy

•

Twitter Handle : shekhargulati

•

Github https://github.com/shekhargulati

•

Slides http://www.slideshare.net/shekhargulati
AGENDA

●

Get started with OpenShift

●

Develop a location aware application
–

Java EE 6 – Middleware
●

JAX-RS 1.1 – Java API for REST WS

●

CDI – Context and Dependency Injection

–

MongoDB – Database

–

OpenShift – Deployment choice

http://sharemylocation-shekhargulati.rhcloud.com/
CODE DU JOUR

https://github.com/shekhargulati/sharemylocation-demo
OpenShift

OPENSHIFT OVERVIEW
OpenShift
is

PaaS by Red Hat

Multi-language,
Auto-Scaling,
Self-service,
Elastic,
Cloud Application
Platform
WHY OPENSHIFT?

●

●

Supports MongoDB , PostgreSQL ,and MySQL
Multi-language support. Supports Java, Node.js, Perl,
Python, PHP and Ruby

●

Extensible via DIY and cartridges

●

No need to learn anything new

●

Open source – OpenShift Origin

●

Scalable

●

FREE!
OUR STACK

8
FLAVORS OF OPENSHIFT

Open
Source
Project

Public
Cloud
Service

origin

Onpremise
or Private
Cloud
Software
OPENSHIFT – GETTING
STARTED

Go to
https://openshift.redhat.com/app/account/new

Promo code is DEVFEST2013

Verify Email

10
TOOLS REQUIRED

1. Eclipse for Java EE
(Kepler)
2. Git
3. Modern browser

11
LAB 1 : HELLO OPENSHIFT

1. Install OpenShift Eclipse plugin
2. Create new application with JBoss EAP and MongoDB
cartridges.
1. Sign up for OpenShift(if not already)
2. Create domain name or namespace
3. Upload SSH keys to OpenShift
4. Fill application creation wizard
5. Finish

3. Make a change in index.html
1. Commit the change using Git Staging view
2. Publish the change

4.View application in browser
12
LAB 2 : HOT DEPLOYMENT

1. Right click on your project and then go to
OpenShift > Configure Markers
2. Choose Hot Deploy marker
3. Commit to git repository
4. Go to servers view and publish your changes.

13
LAB 3 : SET UP JAX RS

14
LAB 3 : REST INTRODUCTION

1. HTTP used right
2. Defines set of RESTful constraints
1. Everything is a resource
1. Eg. Post , Tweet , User , etc.

2. Every resource has an identifier
1. Eg. http://api/twitter.com/tweets/1000011111

3. Resource can have multiple representations
1. JSON , XML , YAML , etc.

4. All resources expose a uniform interface
1. GET , POST , PUT , DELETE

5. Hypermedia as the engine of application state

15
LAB 3 JAX-RS INTRODUCTION

1. Java API for REST Services
2. POJO based
3. Annotation heavy
4. HTTP Centric
5. Format independent
6. Container independent
7. Included with Java EE 6
In this workshop we will be talking about JAX-RS 1.1

16
LAB 3 : SET UP JAX RS

1. Update to Java 7
2. Update Maven war plugin to 2.3
3. Create JAX-RS configuration class.
4. Write PingResource
git remote add upstream -m master
https://github.com/shekhargulati/sharemylocation-demo.git

git fetch –all
git reset --hard upstream/lab3

17
LAB 4 : CONFIGURE CDI AND
MONGODB

18
CDI

1. CDI stands for Context and Dependency Injection
2. CDI simplifies and sanitizes the API for DI and AOP
like JPA did for ORM -- CDI Tutorial by Rick Hightower
3. Type safe approach to Dependency Injection
4. Strong typing and loose coupling
5. To configure CDI add beans.xml to
1. WEB-INF of WAR
2. META-INF of JAR

6. Beans can be injected at method , field , or
constructor.
19
CDI EXAMPLE

20
MONGODB
WHAT IS MONGODB



Open Source NoSQL document datastore
– JSON style documents



Schema-less
– Each document is heterogeneous, and may have completely
unique structure compared to other documents



Fast and horizontally scalable



Rich query language



Rich documents



Easy to get running



Geospatial indexing

22
MONGODB TERMINOLOGY

Database →

Database

Table

→

Collection

Row

→

Document

Index

→

Index
SOME QUERIES

// Find all the jobs with skill as mongodb

db.jobs.find({"skills":"mongodb"})
// Find all the jobs with python as skill and
near to given location

db.jobs.find({"lngLat":{$near :
[139.69 , 35.68]},
"skills":"python"})
// Find all the python or mongodb jobs
near to given location

db.jobs.find({"lngLat":{$near :
[139.69 , 35.68]},
"skills":{$in :
["mongodb","python"]}})

24
LAB 4 : ENABLE CDI AND
MONGODB CONFIGURATION

1. Create beans.xml in src/main/WEB-INF folder
2. Create ApplicationScoped bean for configuring
MongoDB
3. PingResource writes a document to dummy collection
4. Open Eclipse Remote System Explorer perspective
and connect to gear.
Right click on project
1. Team > Reset > Remote Tracking > upstream/lab4

25
LAB 5 : IMPLEMENT CREATE
AND FIND ALL STATUS

1. Creates Status domain class
2. Creates converter for Status to DBObject and vice
versa
3. Creates StatusResource with create and find all
endpoints.
4. Creates ApplicationDao with create and findAll
methods.
5. Creates Twitter Bootstrap and Backbonejs front end for
create and find all functionalities.
Right click on project
–

26

Team > Reset > Remote Tracking > upstream/lab5
LAB 6 : IMPLEMENT NEAR AND
GEONEAR FEATURES

1. Creates findNear and findGeoNear methods in
ApplicationDao
2. Creates near and geonear search REST endpoints in
StatusResource
3. Implements backbone views for search endpoints
4. Create Index
1. db.statuses.ensureIndex({“location”:”2dsphere”})

Right click on project
–

27

Team > Reset > Remote Tracking > upstream/lab6
QUESTIONS?
DONE!
STEP 1 : CHOOSE OPENSHIFT
TOOLS

30
STEP 1 : SEARCH JBOSS
TOOLS

31
GEOSPATIAL INDEXING
BASICS



What is it for?





Find all the MongoDB jobs near me – Proximity Queries
Find all the MongoDB jobs within Bangalore – Bounded
Queries
Find all the MongoDB job at this location – Exact Queries

●

Supports only two dimensional indexes.



You can only have one geospatial index per collection.



By default, 2d geospatial indexes assume longitude
and latitude have boundaries of -180 inclusive and 180
non-inclusive (i.e. [-180, 180))
32
HOW TO MAKE IT WORK

1)

Put your coordinates into an array

{ loc : [ 50 , 30 ] } //SUGGESTED OPTION
{ loc : { x : 50 , y : 30 } }
{ loc : { foo : 50 , y : 30 } }
1) { loc : { lon : 40.739037, lat: 73.992964 } }
2)

Make a 2d index
db.places.ensureIndex( { loc : "2d" } )

3)

33

If you use latitude and longitude as your coordinate system,
always store longitude first. MongoDB’s 2d spherical index
operators only recognize [ longitude, latitude] ordering.

More Related Content

What's hot

Advanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
Advanced Git Techniques: Subtrees, Grafting, and Other Fun StuffAdvanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
Advanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
Atlassian
 
An OpenShift Migration: From 3.9 to 4.5
An OpenShift Migration: From 3.9 to 4.5An OpenShift Migration: From 3.9 to 4.5
An OpenShift Migration: From 3.9 to 4.5
Everett Toews
 
Power Up Your Build - Omer van Kloeten @ Wix 2018-04
Power Up Your Build - Omer van Kloeten @ Wix 2018-04Power Up Your Build - Omer van Kloeten @ Wix 2018-04
Power Up Your Build - Omer van Kloeten @ Wix 2018-04
Omer van Kloeten
 
はじめての JFrog Artifactory
はじめての JFrog Artifactoryはじめての JFrog Artifactory
はじめての JFrog Artifactory
Tsuyoshi Miyake
 
HTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIs
HTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIsHTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIs
HTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIs
Roan Brasil Monteiro
 
Cocoapods Overview - library dependency manager for iOS
Cocoapods Overview - library dependency manager for iOSCocoapods Overview - library dependency manager for iOS
Cocoapods Overview - library dependency manager for iOS
Prajwal S Prakash
 
Cocoapods in action
Cocoapods in actionCocoapods in action
Cocoapods in action
Han Qin
 
Hacking Git and GitHub
Hacking Git and GitHubHacking Git and GitHub
Hacking Git and GitHub
Edureka!
 
GitFlow, SourceTree and GitLab
GitFlow, SourceTree and GitLabGitFlow, SourceTree and GitLab
GitFlow, SourceTree and GitLab
Shinu Suresh
 
Building a Scalable CI Platform using Docker, Drone and Rancher
Building a Scalable CI  Platform using Docker, Drone and RancherBuilding a Scalable CI  Platform using Docker, Drone and Rancher
Building a Scalable CI Platform using Docker, Drone and Rancher
Shannon Williams
 
Using Git with Drupal
Using Git with DrupalUsing Git with Drupal
Using Git with Drupal
Ryan Cross
 
CI/CD with Rancher CLI + Jenkins
CI/CD with Rancher CLI + JenkinsCI/CD with Rancher CLI + Jenkins
CI/CD with Rancher CLI + Jenkins
Go Chiba
 
Intro to Git for Drupal 7
Intro to Git for Drupal 7Intro to Git for Drupal 7
Intro to Git for Drupal 7
Chris Caple
 
Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub Actions
Bo-Yi Wu
 
Writing Commits for You, Your Friends, and Your Future Self
Writing Commits for You, Your Friends, and Your Future SelfWriting Commits for You, Your Friends, and Your Future Self
Writing Commits for You, Your Friends, and Your Future Self
All Things Open
 
Vagrant - the essence of DevOps in a tool
Vagrant - the essence of DevOps in a toolVagrant - the essence of DevOps in a tool
Vagrant - the essence of DevOps in a tool
Paul Stack
 
DevQuiz 2011 の模範解答 Android編
DevQuiz 2011 の模範解答 Android編DevQuiz 2011 の模範解答 Android編
DevQuiz 2011 の模範解答 Android編
Makoto Yamazaki
 
Bedjango talk about Git & GitHub
Bedjango talk about Git & GitHubBedjango talk about Git & GitHub
Bedjango talk about Git & GitHub
BeDjango
 
沒有 GUI 的 Git
沒有 GUI 的 Git沒有 GUI 的 Git
沒有 GUI 的 Git
Chia Wei Tsai
 
A painless self-hosted Git service: Gitea
A painless self-hosted Git service: GiteaA painless self-hosted Git service: Gitea
A painless self-hosted Git service: Gitea
Bo-Yi Wu
 

What's hot (20)

Advanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
Advanced Git Techniques: Subtrees, Grafting, and Other Fun StuffAdvanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
Advanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
 
An OpenShift Migration: From 3.9 to 4.5
An OpenShift Migration: From 3.9 to 4.5An OpenShift Migration: From 3.9 to 4.5
An OpenShift Migration: From 3.9 to 4.5
 
Power Up Your Build - Omer van Kloeten @ Wix 2018-04
Power Up Your Build - Omer van Kloeten @ Wix 2018-04Power Up Your Build - Omer van Kloeten @ Wix 2018-04
Power Up Your Build - Omer van Kloeten @ Wix 2018-04
 
はじめての JFrog Artifactory
はじめての JFrog Artifactoryはじめての JFrog Artifactory
はじめての JFrog Artifactory
 
HTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIs
HTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIsHTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIs
HTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIs
 
Cocoapods Overview - library dependency manager for iOS
Cocoapods Overview - library dependency manager for iOSCocoapods Overview - library dependency manager for iOS
Cocoapods Overview - library dependency manager for iOS
 
Cocoapods in action
Cocoapods in actionCocoapods in action
Cocoapods in action
 
Hacking Git and GitHub
Hacking Git and GitHubHacking Git and GitHub
Hacking Git and GitHub
 
GitFlow, SourceTree and GitLab
GitFlow, SourceTree and GitLabGitFlow, SourceTree and GitLab
GitFlow, SourceTree and GitLab
 
Building a Scalable CI Platform using Docker, Drone and Rancher
Building a Scalable CI  Platform using Docker, Drone and RancherBuilding a Scalable CI  Platform using Docker, Drone and Rancher
Building a Scalable CI Platform using Docker, Drone and Rancher
 
Using Git with Drupal
Using Git with DrupalUsing Git with Drupal
Using Git with Drupal
 
CI/CD with Rancher CLI + Jenkins
CI/CD with Rancher CLI + JenkinsCI/CD with Rancher CLI + Jenkins
CI/CD with Rancher CLI + Jenkins
 
Intro to Git for Drupal 7
Intro to Git for Drupal 7Intro to Git for Drupal 7
Intro to Git for Drupal 7
 
Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub Actions
 
Writing Commits for You, Your Friends, and Your Future Self
Writing Commits for You, Your Friends, and Your Future SelfWriting Commits for You, Your Friends, and Your Future Self
Writing Commits for You, Your Friends, and Your Future Self
 
Vagrant - the essence of DevOps in a tool
Vagrant - the essence of DevOps in a toolVagrant - the essence of DevOps in a tool
Vagrant - the essence of DevOps in a tool
 
DevQuiz 2011 の模範解答 Android編
DevQuiz 2011 の模範解答 Android編DevQuiz 2011 の模範解答 Android編
DevQuiz 2011 の模範解答 Android編
 
Bedjango talk about Git & GitHub
Bedjango talk about Git & GitHubBedjango talk about Git & GitHub
Bedjango talk about Git & GitHub
 
沒有 GUI 的 Git
沒有 GUI 的 Git沒有 GUI 的 Git
沒有 GUI 的 Git
 
A painless self-hosted Git service: Gitea
A painless self-hosted Git service: GiteaA painless self-hosted Git service: Gitea
A painless self-hosted Git service: Gitea
 

Viewers also liked

AngularJS & Job
AngularJS & JobAngularJS & Job
AngularJS & Job
ganesgo
 
Simple Mobile Development With Ionic - Ondrisek
Simple Mobile Development With Ionic - OndrisekSimple Mobile Development With Ionic - Ondrisek
Simple Mobile Development With Ionic - Ondrisek
Barbara Ondrisek
 
Working effectively with OpenShift
Working effectively with OpenShiftWorking effectively with OpenShift
Working effectively with OpenShift
Shekhar Gulati
 
Developing Great Apps with Apache Cordova
Developing Great Apps with Apache CordovaDeveloping Great Apps with Apache Cordova
Developing Great Apps with Apache Cordova
Shekhar Gulati
 
Introduction to Browser DOM
Introduction to Browser DOMIntroduction to Browser DOM
Introduction to Browser DOM
Siva Arunachalam
 
A Happy Cloud Friendly Java Developer with OpenShift
A Happy Cloud Friendly Java Developer with OpenShiftA Happy Cloud Friendly Java Developer with OpenShift
A Happy Cloud Friendly Java Developer with OpenShift
Shekhar Gulati
 
Open shift for java(ee) developers
Open shift for java(ee) developersOpen shift for java(ee) developers
Open shift for java(ee) developers
Shekhar Gulati
 
Indic threads java10-spring-roo-and-the-cloud
Indic threads java10-spring-roo-and-the-cloudIndic threads java10-spring-roo-and-the-cloud
Indic threads java10-spring-roo-and-the-cloud
Shekhar Gulati
 
Developing modern java web applications with java ee 7 and angular js
Developing modern java web applications with java ee 7 and angular jsDeveloping modern java web applications with java ee 7 and angular js
Developing modern java web applications with java ee 7 and angular js
Shekhar Gulati
 
Hicss 42 Presentation
Hicss 42 PresentationHicss 42 Presentation
Hicss 42 Presentation
Barbara Ondrisek
 
Interacting with the DOM (JavaScript)
Interacting with the DOM (JavaScript)Interacting with the DOM (JavaScript)
Interacting with the DOM (JavaScript)
Florence Davis
 
Surviving as a Professional Software Developer
Surviving as a Professional Software DeveloperSurviving as a Professional Software Developer
Surviving as a Professional Software Developer
Yakov Fain
 
Becoming a professional software developer
Becoming a professional software developerBecoming a professional software developer
Becoming a professional software developer
Yakov Fain
 
Thinking beyond RDBMS - Building Polyglot Persistence Java Applications Devf...
Thinking beyond RDBMS  - Building Polyglot Persistence Java Applications Devf...Thinking beyond RDBMS  - Building Polyglot Persistence Java Applications Devf...
Thinking beyond RDBMS - Building Polyglot Persistence Java Applications Devf...
Shekhar Gulati
 
Bringing spatial love to your python application
Bringing spatial love to your python applicationBringing spatial love to your python application
Bringing spatial love to your python application
Shekhar Gulati
 
Design Patterns for JavaScript Web Apps - JavaScript Conference 2012 - OPITZ ...
Design Patterns for JavaScript Web Apps - JavaScript Conference 2012 - OPITZ ...Design Patterns for JavaScript Web Apps - JavaScript Conference 2012 - OPITZ ...
Design Patterns for JavaScript Web Apps - JavaScript Conference 2012 - OPITZ ...
OPITZ CONSULTING Deutschland
 
Building spatial back ends with Node.js and MongoDB
Building spatial back ends with Node.js and MongoDBBuilding spatial back ends with Node.js and MongoDB
Building spatial back ends with Node.js and MongoDB
Shekhar Gulati
 
Angularjs interview questions and answers
Angularjs interview questions and answersAngularjs interview questions and answers
Angularjs interview questions and answers
Anil Singh
 
Real World AngularJS recipes: beyond TodoMVC
Real World AngularJS recipes: beyond TodoMVCReal World AngularJS recipes: beyond TodoMVC
Real World AngularJS recipes: beyond TodoMVC
Carlo Bonamico
 
AngularJS in large applications - AE NV
AngularJS in large applications - AE NVAngularJS in large applications - AE NV
AngularJS in large applications - AE NV
AE - architects for business and ict
 

Viewers also liked (20)

AngularJS & Job
AngularJS & JobAngularJS & Job
AngularJS & Job
 
Simple Mobile Development With Ionic - Ondrisek
Simple Mobile Development With Ionic - OndrisekSimple Mobile Development With Ionic - Ondrisek
Simple Mobile Development With Ionic - Ondrisek
 
Working effectively with OpenShift
Working effectively with OpenShiftWorking effectively with OpenShift
Working effectively with OpenShift
 
Developing Great Apps with Apache Cordova
Developing Great Apps with Apache CordovaDeveloping Great Apps with Apache Cordova
Developing Great Apps with Apache Cordova
 
Introduction to Browser DOM
Introduction to Browser DOMIntroduction to Browser DOM
Introduction to Browser DOM
 
A Happy Cloud Friendly Java Developer with OpenShift
A Happy Cloud Friendly Java Developer with OpenShiftA Happy Cloud Friendly Java Developer with OpenShift
A Happy Cloud Friendly Java Developer with OpenShift
 
Open shift for java(ee) developers
Open shift for java(ee) developersOpen shift for java(ee) developers
Open shift for java(ee) developers
 
Indic threads java10-spring-roo-and-the-cloud
Indic threads java10-spring-roo-and-the-cloudIndic threads java10-spring-roo-and-the-cloud
Indic threads java10-spring-roo-and-the-cloud
 
Developing modern java web applications with java ee 7 and angular js
Developing modern java web applications with java ee 7 and angular jsDeveloping modern java web applications with java ee 7 and angular js
Developing modern java web applications with java ee 7 and angular js
 
Hicss 42 Presentation
Hicss 42 PresentationHicss 42 Presentation
Hicss 42 Presentation
 
Interacting with the DOM (JavaScript)
Interacting with the DOM (JavaScript)Interacting with the DOM (JavaScript)
Interacting with the DOM (JavaScript)
 
Surviving as a Professional Software Developer
Surviving as a Professional Software DeveloperSurviving as a Professional Software Developer
Surviving as a Professional Software Developer
 
Becoming a professional software developer
Becoming a professional software developerBecoming a professional software developer
Becoming a professional software developer
 
Thinking beyond RDBMS - Building Polyglot Persistence Java Applications Devf...
Thinking beyond RDBMS  - Building Polyglot Persistence Java Applications Devf...Thinking beyond RDBMS  - Building Polyglot Persistence Java Applications Devf...
Thinking beyond RDBMS - Building Polyglot Persistence Java Applications Devf...
 
Bringing spatial love to your python application
Bringing spatial love to your python applicationBringing spatial love to your python application
Bringing spatial love to your python application
 
Design Patterns for JavaScript Web Apps - JavaScript Conference 2012 - OPITZ ...
Design Patterns for JavaScript Web Apps - JavaScript Conference 2012 - OPITZ ...Design Patterns for JavaScript Web Apps - JavaScript Conference 2012 - OPITZ ...
Design Patterns for JavaScript Web Apps - JavaScript Conference 2012 - OPITZ ...
 
Building spatial back ends with Node.js and MongoDB
Building spatial back ends with Node.js and MongoDBBuilding spatial back ends with Node.js and MongoDB
Building spatial back ends with Node.js and MongoDB
 
Angularjs interview questions and answers
Angularjs interview questions and answersAngularjs interview questions and answers
Angularjs interview questions and answers
 
Real World AngularJS recipes: beyond TodoMVC
Real World AngularJS recipes: beyond TodoMVCReal World AngularJS recipes: beyond TodoMVC
Real World AngularJS recipes: beyond TodoMVC
 
AngularJS in large applications - AE NV
AngularJS in large applications - AE NVAngularJS in large applications - AE NV
AngularJS in large applications - AE NV
 

Similar to Java EE 6 and NoSQL Workshop DevFest Austria

Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud
Shekhar Gulati
 
From CoreOS to Kubernetes and Concourse CI
From CoreOS to Kubernetes and Concourse CIFrom CoreOS to Kubernetes and Concourse CI
From CoreOS to Kubernetes and Concourse CI
Denis Izmaylov
 
Meetup 2022 - APIs with Quarkus.pdf
Meetup 2022 - APIs with Quarkus.pdfMeetup 2022 - APIs with Quarkus.pdf
Meetup 2022 - APIs with Quarkus.pdf
Red Hat
 
faastRuby - Building a FaaS platform with Redis (RedisConf19)
faastRuby - Building a FaaS platform with Redis (RedisConf19)faastRuby - Building a FaaS platform with Redis (RedisConf19)
faastRuby - Building a FaaS platform with Redis (RedisConf19)
Paulo Arruda
 
Building A FaaA Platform With Redis: Paulo Arruda
Building A FaaA Platform With Redis: Paulo ArrudaBuilding A FaaA Platform With Redis: Paulo Arruda
Building A FaaA Platform With Redis: Paulo Arruda
Redis Labs
 
Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...
Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...
Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...
AgileNCR2013
 
Java Libraries You Can’t Afford to Miss
Java Libraries You Can’t Afford to MissJava Libraries You Can’t Afford to Miss
Java Libraries You Can’t Afford to Miss
Andres Almiray
 
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
Jesse Gallagher
 
How to Build & Use OpenCL on OpenCV & Android NDK
How to Build & Use OpenCL on OpenCV & Android NDKHow to Build & Use OpenCL on OpenCV & Android NDK
Using Chef and Vagrant at Gengo
Using Chef and Vagrant at GengoUsing Chef and Vagrant at Gengo
Using Chef and Vagrant at Gengo
Gengo
 
Play Support in Cloud Foundry
Play Support in Cloud FoundryPlay Support in Cloud Foundry
Play Support in Cloud Foundry
rajdeep
 
Spring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
Spring Boot to Quarkus: A real app migration experience | DevNation Tech TalkSpring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
Spring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
Red Hat Developers
 
OpenShift meetup Bangalore
OpenShift meetup BangaloreOpenShift meetup Bangalore
OpenShift meetup Bangalore
Suraj Deshmukh
 
Migration Spring Boot PetClinic REST to Quarkus 1.2.0
Migration Spring Boot PetClinic REST to Quarkus 1.2.0Migration Spring Boot PetClinic REST to Quarkus 1.2.0
Migration Spring Boot PetClinic REST to Quarkus 1.2.0
Jonathan Vila
 
DevNexus 2017 - Building and Deploying 12 Factor Apps in Scala, Java, Ruby, a...
DevNexus 2017 - Building and Deploying 12 Factor Apps in Scala, Java, Ruby, a...DevNexus 2017 - Building and Deploying 12 Factor Apps in Scala, Java, Ruby, a...
DevNexus 2017 - Building and Deploying 12 Factor Apps in Scala, Java, Ruby, a...
Neil Shannon
 
NLUUG Spring 2012 - OpenShift Primer
NLUUG Spring 2012 - OpenShift PrimerNLUUG Spring 2012 - OpenShift Primer
NLUUG Spring 2012 - OpenShift Primer
Eric D. Schabell
 
OpenShift Primer - get your business into the Cloud today!
OpenShift Primer - get your business into the Cloud today!OpenShift Primer - get your business into the Cloud today!
OpenShift Primer - get your business into the Cloud today!
Eric D. Schabell
 
DavidWible_res
DavidWible_resDavidWible_res
DavidWible_res
david wible
 
node.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoonnode.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoon
Jesang Yoon
 
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of Choice
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of ChoicePaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of Choice
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of Choice
Isaac Christoffersen
 

Similar to Java EE 6 and NoSQL Workshop DevFest Austria (20)

Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud
 
From CoreOS to Kubernetes and Concourse CI
From CoreOS to Kubernetes and Concourse CIFrom CoreOS to Kubernetes and Concourse CI
From CoreOS to Kubernetes and Concourse CI
 
Meetup 2022 - APIs with Quarkus.pdf
Meetup 2022 - APIs with Quarkus.pdfMeetup 2022 - APIs with Quarkus.pdf
Meetup 2022 - APIs with Quarkus.pdf
 
faastRuby - Building a FaaS platform with Redis (RedisConf19)
faastRuby - Building a FaaS platform with Redis (RedisConf19)faastRuby - Building a FaaS platform with Redis (RedisConf19)
faastRuby - Building a FaaS platform with Redis (RedisConf19)
 
Building A FaaA Platform With Redis: Paulo Arruda
Building A FaaA Platform With Redis: Paulo ArrudaBuilding A FaaA Platform With Redis: Paulo Arruda
Building A FaaA Platform With Redis: Paulo Arruda
 
Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...
Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...
Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...
 
Java Libraries You Can’t Afford to Miss
Java Libraries You Can’t Afford to MissJava Libraries You Can’t Afford to Miss
Java Libraries You Can’t Afford to Miss
 
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
 
How to Build & Use OpenCL on OpenCV & Android NDK
How to Build & Use OpenCL on OpenCV & Android NDKHow to Build & Use OpenCL on OpenCV & Android NDK
How to Build & Use OpenCL on OpenCV & Android NDK
 
Using Chef and Vagrant at Gengo
Using Chef and Vagrant at GengoUsing Chef and Vagrant at Gengo
Using Chef and Vagrant at Gengo
 
Play Support in Cloud Foundry
Play Support in Cloud FoundryPlay Support in Cloud Foundry
Play Support in Cloud Foundry
 
Spring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
Spring Boot to Quarkus: A real app migration experience | DevNation Tech TalkSpring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
Spring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
 
OpenShift meetup Bangalore
OpenShift meetup BangaloreOpenShift meetup Bangalore
OpenShift meetup Bangalore
 
Migration Spring Boot PetClinic REST to Quarkus 1.2.0
Migration Spring Boot PetClinic REST to Quarkus 1.2.0Migration Spring Boot PetClinic REST to Quarkus 1.2.0
Migration Spring Boot PetClinic REST to Quarkus 1.2.0
 
DevNexus 2017 - Building and Deploying 12 Factor Apps in Scala, Java, Ruby, a...
DevNexus 2017 - Building and Deploying 12 Factor Apps in Scala, Java, Ruby, a...DevNexus 2017 - Building and Deploying 12 Factor Apps in Scala, Java, Ruby, a...
DevNexus 2017 - Building and Deploying 12 Factor Apps in Scala, Java, Ruby, a...
 
NLUUG Spring 2012 - OpenShift Primer
NLUUG Spring 2012 - OpenShift PrimerNLUUG Spring 2012 - OpenShift Primer
NLUUG Spring 2012 - OpenShift Primer
 
OpenShift Primer - get your business into the Cloud today!
OpenShift Primer - get your business into the Cloud today!OpenShift Primer - get your business into the Cloud today!
OpenShift Primer - get your business into the Cloud today!
 
DavidWible_res
DavidWible_resDavidWible_res
DavidWible_res
 
node.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoonnode.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoon
 
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of Choice
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of ChoicePaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of Choice
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of Choice
 

Recently uploaded

Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
Federico Razzoli
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 

Recently uploaded (20)

Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 

Java EE 6 and NoSQL Workshop DevFest Austria

  • 1. OPENSHIFT JEE6 and NoSQL in the Cloud Workshop PRESENTED BY Shekhar Gulati
  • 2. WHO AM I? • Shekhar Gulati -- OpenShift Developer Evangelist • Java / JavaScript / Python / NoSQL / Cloud Guy • Twitter Handle : shekhargulati • Github https://github.com/shekhargulati • Slides http://www.slideshare.net/shekhargulati
  • 3. AGENDA ● Get started with OpenShift ● Develop a location aware application – Java EE 6 – Middleware ● JAX-RS 1.1 – Java API for REST WS ● CDI – Context and Dependency Injection – MongoDB – Database – OpenShift – Deployment choice http://sharemylocation-shekhargulati.rhcloud.com/
  • 6. OpenShift is PaaS by Red Hat Multi-language, Auto-Scaling, Self-service, Elastic, Cloud Application Platform
  • 7. WHY OPENSHIFT? ● ● Supports MongoDB , PostgreSQL ,and MySQL Multi-language support. Supports Java, Node.js, Perl, Python, PHP and Ruby ● Extensible via DIY and cartridges ● No need to learn anything new ● Open source – OpenShift Origin ● Scalable ● FREE!
  • 10. OPENSHIFT – GETTING STARTED Go to https://openshift.redhat.com/app/account/new Promo code is DEVFEST2013 Verify Email 10
  • 11. TOOLS REQUIRED 1. Eclipse for Java EE (Kepler) 2. Git 3. Modern browser 11
  • 12. LAB 1 : HELLO OPENSHIFT 1. Install OpenShift Eclipse plugin 2. Create new application with JBoss EAP and MongoDB cartridges. 1. Sign up for OpenShift(if not already) 2. Create domain name or namespace 3. Upload SSH keys to OpenShift 4. Fill application creation wizard 5. Finish 3. Make a change in index.html 1. Commit the change using Git Staging view 2. Publish the change 4.View application in browser 12
  • 13. LAB 2 : HOT DEPLOYMENT 1. Right click on your project and then go to OpenShift > Configure Markers 2. Choose Hot Deploy marker 3. Commit to git repository 4. Go to servers view and publish your changes. 13
  • 14. LAB 3 : SET UP JAX RS 14
  • 15. LAB 3 : REST INTRODUCTION 1. HTTP used right 2. Defines set of RESTful constraints 1. Everything is a resource 1. Eg. Post , Tweet , User , etc. 2. Every resource has an identifier 1. Eg. http://api/twitter.com/tweets/1000011111 3. Resource can have multiple representations 1. JSON , XML , YAML , etc. 4. All resources expose a uniform interface 1. GET , POST , PUT , DELETE 5. Hypermedia as the engine of application state 15
  • 16. LAB 3 JAX-RS INTRODUCTION 1. Java API for REST Services 2. POJO based 3. Annotation heavy 4. HTTP Centric 5. Format independent 6. Container independent 7. Included with Java EE 6 In this workshop we will be talking about JAX-RS 1.1 16
  • 17. LAB 3 : SET UP JAX RS 1. Update to Java 7 2. Update Maven war plugin to 2.3 3. Create JAX-RS configuration class. 4. Write PingResource git remote add upstream -m master https://github.com/shekhargulati/sharemylocation-demo.git git fetch –all git reset --hard upstream/lab3 17
  • 18. LAB 4 : CONFIGURE CDI AND MONGODB 18
  • 19. CDI 1. CDI stands for Context and Dependency Injection 2. CDI simplifies and sanitizes the API for DI and AOP like JPA did for ORM -- CDI Tutorial by Rick Hightower 3. Type safe approach to Dependency Injection 4. Strong typing and loose coupling 5. To configure CDI add beans.xml to 1. WEB-INF of WAR 2. META-INF of JAR 6. Beans can be injected at method , field , or constructor. 19
  • 22. WHAT IS MONGODB  Open Source NoSQL document datastore – JSON style documents  Schema-less – Each document is heterogeneous, and may have completely unique structure compared to other documents  Fast and horizontally scalable  Rich query language  Rich documents  Easy to get running  Geospatial indexing 22
  • 24. SOME QUERIES // Find all the jobs with skill as mongodb db.jobs.find({"skills":"mongodb"}) // Find all the jobs with python as skill and near to given location db.jobs.find({"lngLat":{$near : [139.69 , 35.68]}, "skills":"python"}) // Find all the python or mongodb jobs near to given location db.jobs.find({"lngLat":{$near : [139.69 , 35.68]}, "skills":{$in : ["mongodb","python"]}}) 24
  • 25. LAB 4 : ENABLE CDI AND MONGODB CONFIGURATION 1. Create beans.xml in src/main/WEB-INF folder 2. Create ApplicationScoped bean for configuring MongoDB 3. PingResource writes a document to dummy collection 4. Open Eclipse Remote System Explorer perspective and connect to gear. Right click on project 1. Team > Reset > Remote Tracking > upstream/lab4 25
  • 26. LAB 5 : IMPLEMENT CREATE AND FIND ALL STATUS 1. Creates Status domain class 2. Creates converter for Status to DBObject and vice versa 3. Creates StatusResource with create and find all endpoints. 4. Creates ApplicationDao with create and findAll methods. 5. Creates Twitter Bootstrap and Backbonejs front end for create and find all functionalities. Right click on project – 26 Team > Reset > Remote Tracking > upstream/lab5
  • 27. LAB 6 : IMPLEMENT NEAR AND GEONEAR FEATURES 1. Creates findNear and findGeoNear methods in ApplicationDao 2. Creates near and geonear search REST endpoints in StatusResource 3. Implements backbone views for search endpoints 4. Create Index 1. db.statuses.ensureIndex({“location”:”2dsphere”}) Right click on project – 27 Team > Reset > Remote Tracking > upstream/lab6
  • 29. DONE!
  • 30. STEP 1 : CHOOSE OPENSHIFT TOOLS 30
  • 31. STEP 1 : SEARCH JBOSS TOOLS 31
  • 32. GEOSPATIAL INDEXING BASICS  What is it for?    Find all the MongoDB jobs near me – Proximity Queries Find all the MongoDB jobs within Bangalore – Bounded Queries Find all the MongoDB job at this location – Exact Queries ● Supports only two dimensional indexes.  You can only have one geospatial index per collection.  By default, 2d geospatial indexes assume longitude and latitude have boundaries of -180 inclusive and 180 non-inclusive (i.e. [-180, 180)) 32
  • 33. HOW TO MAKE IT WORK 1) Put your coordinates into an array { loc : [ 50 , 30 ] } //SUGGESTED OPTION { loc : { x : 50 , y : 30 } } { loc : { foo : 50 , y : 30 } } 1) { loc : { lon : 40.739037, lat: 73.992964 } } 2) Make a 2d index db.places.ensureIndex( { loc : "2d" } ) 3) 33 If you use latitude and longitude as your coordinate system, always store longitude first. MongoDB’s 2d spherical index operators only recognize [ longitude, latitude] ordering.