SlideShare a Scribd company logo
1 of 45
Download to read offline
3/11/13                                     reveal.js - The HTML Presentation Framework




                                    BUILDING SPATIAL
                                       BACK-ENDS
                                               with
                                              node.js
                                               and
                                             MongoDB

                                          bit.ly/WUXJWD




ryanjarvinen.com/presentations/parks/#/                                                   1/45
3/11/13                                        reveal.js - The HTML Presentation Framework




                                              presented by

                                          ryan jarvinen / @ryanj




ryanjarvinen.com/presentations/parks/#/                                                      2/45
3/11/13                                         reveal.js - The HTML Presentation Framework




                                          Open Platform Evangelist
                                                     at
                                                  Red Hat

                                             ryanj@redhat.com




ryanjarvinen.com/presentations/parks/#/                                                       3/45
3/11/13                                     reveal.js - The HTML Presentation Framework




                                          AGENDA
                         Learn some basic spatial
                         Load spatial data into MongoDB
                         Run a query or two
                         Go live with a Mongo-powered spatial app in ~30 mins




ryanjarvinen.com/presentations/parks/#/                                                   4/45
3/11/13                                             reveal.js - The HTML Presentation Framework




                                           CODE DU JOUR
                    https://github.com/openshift/openshift-mongo-node-
                                      express-example

                                          Signup with Code - MONGOLA2013




ryanjarvinen.com/presentations/parks/#/                                                           5/45
3/11/13                                     reveal.js - The HTML Presentation Framework




                                          THE CLOUD
                                              IS
                          A FREE-MARKET FOR ONLINE SERVICES




ryanjarvinen.com/presentations/parks/#/                                                   6/45
3/11/13                                   reveal.js - The HTML Presentation Framework




                 THE CLOUD LANDSCAPE



ryanjarvinen.com/presentations/parks/#/                                                 7/45
3/11/13                                   reveal.js - The HTML Presentation Framework




ryanjarvinen.com/presentations/parks/#/                                                 8/45
3/11/13                                      reveal.js - The HTML Presentation Framework




                                          THE BIG PICTURE




ryanjarvinen.com/presentations/parks/#/                                                    9/45
3/11/13                                   reveal.js - The HTML Presentation Framework




ryanjarvinen.com/presentations/parks/#/                                                 10/45
3/11/13                                        reveal.js - The HTML Presentation Framework




                                              OPENSTACK
                                              IS OPEN
                                                          and


                                          FOCUSED ON IAAS

ryanjarvinen.com/presentations/parks/#/                                                      11/45
3/11/13                                    reveal.js - The HTML Presentation Framework




                                      PUBLIC CLOUD +
                                      PRIVATE CLOUD =
                                       HYBRID CLOUD

ryanjarvinen.com/presentations/parks/#/                                                  12/45
3/11/13                                     reveal.js - The HTML Presentation Framework




                                          OPENSHIFT IS…
                                            OPEN


ryanjarvinen.com/presentations/parks/#/                                                   13/45
3/11/13                                        reveal.js - The HTML Presentation Framework




                                          OPEN CARTRIDGE
                                             FORMAT


ryanjarvinen.com/presentations/parks/#/                                                      14/45
3/11/13                                     reveal.js - The HTML Presentation Framework




                                          OPEN SOURCE
                                    OPENSHIFT ORIGIN


ryanjarvinen.com/presentations/parks/#/                                                   15/45
3/11/13                                         reveal.js - The HTML Presentation Framework




                                            HOSTING OPTIONS
                                                  DIY
                                            OPENSHIFT ONLINE
                                          OPENSHIFT ENTERPRISE




ryanjarvinen.com/presentations/parks/#/                                                       16/45
3/11/13                                                  reveal.js - The HTML Presentation Framework




                                                 DEVELOPER PREVIEW
                  Make sure that you sign up for a free OpenShift account
                              http://openshift.redhat.com/
                                          Free-as-in-beer
                                          Free-as-in-freedom
                                          512 MB RAM / 1 GB storage per gears (3 free)
                                          Need more resources, just ask!
                                          REALLY a Developer Preview




ryanjarvinen.com/presentations/parks/#/                                                                17/45
3/11/13                                    reveal.js - The HTML Presentation Framework




                                GETTING STARTED WITH OPENSHIFT
                                            PRE-REQUISITES:
                                          ruby, rubygems
                                                 git




ryanjarvinen.com/presentations/parks/#/                                                  18/45
3/11/13                                      reveal.js - The HTML Presentation Framework




                                 INSTALLING THE 'RHC' CLIENT TOOL
                          sd gmisalrc
                          uo e ntl h

                                                  and
                                            install node.js




ryanjarvinen.com/presentations/parks/#/                                                    19/45
3/11/13                                             reveal.js - The HTML Presentation Framework




                                          HELP WITH CLIENT TOOLS
                                           Openshift Getting Started guide
                                           RHC client tools installation




ryanjarvinen.com/presentations/parks/#/                                                           20/45
3/11/13                                             reveal.js - The HTML Presentation Framework




                        CONFIGURING YOUR DEV ENVIRONMENT
                          rcstp
                          h eu

                                          sets your openshift email address
                                          verifies your ssh key configuration
                                          selects your application namespace




ryanjarvinen.com/presentations/parks/#/                                                           21/45
3/11/13                                   reveal.js - The HTML Presentation Framework




                                  MONGODB SPATIAL



ryanjarvinen.com/presentations/parks/#/                                                 22/45
3/11/13                                       reveal.js - The HTML Presentation Framework




                                          SPATIAL NOTES
                          MongoDB currently supports the following types of
                                         spatial queries:
                                        1. Near
                                        2. Containment

                             MongoDB GIS summary:
                http://www.mongodb.org/display/DOCS/Geospatial+Indexing




ryanjarvinen.com/presentations/parks/#/                                                     23/45
3/11/13                                      reveal.js - The HTML Presentation Framework




                                            MONGODB
                                          ASSUMPTIONS
                       Assumes coords. are between -180 and 180
                       Can handle any 2D coordinates
                       Has methods to handle curvature of the earth
                       (spherical)




ryanjarvinen.com/presentations/parks/#/                                                    24/45
3/11/13                                               reveal.js - The HTML Presentation Framework




                                          MAKING IT WORK
                                              1. Put your data in an array
                          {lc:[5 ,3 ]}/SGETDOTO
                            o   0  0   /UGSE PIN
                          {lc:{x:5 ,y:3 }}
                            o     0     0
                          {lc:{fo:5 ,y:3 }}
                            o   o   0     0
                          {lc:{ln:4.307 lt 7.994}}
                            o   o   0793, a: 3926


                                          2. Add a 2d index to your collection
                          d.lcsesrIdx {lc:"d })
                          bpae.nuene(   o  2"




ryanjarvinen.com/presentations/parks/#/                                                             25/45
3/11/13                                   reveal.js - The HTML Presentation Framework




                        GEARING UP A NEW APP ON OPENSHIFT
                          rcapcet APNM APCRRDE
                          h p rae P_AE P_ATIG

                                                       or
                          rcapcet prsndj mnob22-fo-oehts/gtu
                          h p rae ak oes ogd-. -rmcd=tp:/ihb
                          .o/pnhf/pnhf-og-oeepeseapegt
                          cmoesitoesitmnond-xrs-xml.i




ryanjarvinen.com/presentations/parks/#/                                                 26/45
3/11/13                                   reveal.js - The HTML Presentation Framework




                          ApiainOtos
                          plcto pin
                          ----------
                          ---------
                           Nmsae raj
                            aepc: yn
                           Crrde:ndj-.,mnob22
                            atigs oes06 ogd-.
                           Suc Cd:hts/gtu.o/pnhf/pnhf-og-oee
                            ore oe tp:/ihbcmoesitoesitmnond-
                          xrs-xml.i
                          peseapegt
                           Ga Sz: dfut
                            er ie  eal
                           Saig
                            cln:  no

                          Cetn apiain'ak'..dn
                          raig plcto prs . oe

                          Wiigfryu DSnm t b aalbe..dn
                          atn o or N ae o e vial . oe

                          DwlaigteapiainGtrpstr ..
                          onodn h plcto i eoioy .
                          Coigit 'ak'.
                          lnn no prs..




ryanjarvinen.com/presentations/parks/#/                                                 27/45
3/11/13                                     reveal.js - The HTML Presentation Framework




                          prs@ht:/ak-yn.hlu.o/(ud 2980b84688
                          ak    tp/prsrajrcodcm ui: 5134fd0e9
                          0ae4030
                          21626a)
                          --------------------------
                          -------------------------
                           Cetd
                            rae: 1:3P
                                   02 M
                           Ga Sz:sal
                            er ie ml
                           GtUL
                            i R:
                          sh/2980b8468821626a@ak-yn.hlu.o//
                          s:/5134fd0e90ae4030prsrajrcodcm~g
                          i/ak.i/
                          tprsgt
                           SH
                            S:    2980b8468821626a@ak-yn.hlu.
                                   5134fd0e90ae4030prsrajrcod
                          cm
                          o

                               ndj-. (oej 06
                                oes06 Nd.s .)
                               ------------
                                ------------

                          RSL:
                          EUT
                          Apiainprswscetd
                          plcto ak a rae.




ryanjarvinen.com/presentations/parks/#/                                                   28/45
3/11/13                                   reveal.js - The HTML Presentation Framework




                          Adn mnob22t apiain'ak'..Sces
                          dig ogd-. o plcto prs . ucs

                          mnob22(ogD NSLDtbs 22
                          ogd-. MnoB oQ aaae .)
                          --------------------
                          --------------------
                           Cneto UL mnob/1761219207
                            oncin R: ogd:/2..0.2:71/
                           Dtbs Nm: prs
                            aaae ae  ak
                           Pswr:
                            asod    TxwiZG
                                     5JCDYn
                           Uenm:
                            srae    amn
                                     di

                          RSL:
                          EUT
                          Addmnob22t apiainprs
                          de ogd-. o plcto ak




ryanjarvinen.com/presentations/parks/#/                                                 29/45
3/11/13                                             reveal.js - The HTML Presentation Framework




                                                    SUCCESS!
                            You now have a basic node.js app up an running on
                                              OpenShift!

                                          Your gear is now configured with:
                                                it's own git repo
                                                it's own web server
                                                MongoDB
                                                ssh access
                                                logging
                                                publicly accessible DNS




ryanjarvinen.com/presentations/parks/#/                                                           30/45
3/11/13                                       reveal.js - The HTML Presentation Framework




                                          BUILDING YOUR APP
                             c prs
                              d ak




ryanjarvinen.com/presentations/parks/#/                                                     31/45
3/11/13                                   reveal.js - The HTML Presentation Framework




                            SETTING UP MONGODB ON OPENSHIFT
                          rccrrdeadmnob22
                          h atig d ogd-.




ryanjarvinen.com/presentations/parks/#/                                                 32/45
3/11/13                                              reveal.js - The HTML Presentation Framework




                                          INSTALLING DEPENDENCIES
                                          Using Node's npm package manager :
                          nmisalmnos-
                          p ntl ogj S

                      Include the - flag in order to save this dependency to
                                   S
                             your application's p c a e j o file.
                                                 akg.sn
                               http://npmjs.org/package/mongojs/




ryanjarvinen.com/presentations/parks/#/                                                            33/45
3/11/13                                             reveal.js - The HTML Presentation Framework




                                          COMMITTING YOUR CHANGES
                          gtadpcaejo sre.s
                          i d akg.sn evrj

                                            Commit your changes locally
                          gtcmi - 'digmnosnmdpnec,iiilzn mnos
                          i omt m adn ogj p eedny ntaiig ogj
                          lbay adn abscAI
                           irr, dig  ai P'




ryanjarvinen.com/presentations/parks/#/                                                           34/45
3/11/13                                    reveal.js - The HTML Presentation Framework




                                          DEPLOYMENT
                          gtps
                          i uh

                 Done!Your spatial app should now be live IN THE CLOUD!




ryanjarvinen.com/presentations/parks/#/                                                  35/45
3/11/13                                          reveal.js - The HTML Presentation Framework




                                          ROCKMONGO ON OPENSHIFT
                          rccrrdeadrcmno11
                          h atig d okog-.

                                                    (optional)




ryanjarvinen.com/presentations/parks/#/                                                        36/45
3/11/13                                          reveal.js - The HTML Presentation Framework




                                          CONNECTING TO MONGODB
                          vrmnos=rqie'ogj';
                           a ogj   eur(mnos)
                          vrcneto_tig=btnm;
                           a oncinsrn   o_ae
                          i(rcs.n.PNHF_OGD_BPSWR)
                           fpoesevOESITMNOBD_ASOD{
                            cneto_tig=poesevOESITMNOBD_SRAE+
                             oncinsrn  rcs.n.PNHF_OGD_BUENM
                          ""+
                           :
                           poesevOESITMNOBD_ASOD+""+
                            rcs.n.PNHF_OGD_BPSWR   @
                           poesevOESITMNOBD_OT+''+
                            rcs.n.PNHF_OGD_BHS   /
                           poesevOESITAPNM;
                            rcs.n.PNHF_P_AE
                          }
                          vrd =mnoscneto_tig [soeor')
                           a b  ogj(oncinsrn, 'crbad];




ryanjarvinen.com/presentations/parks/#/                                                        37/45
3/11/13                                            reveal.js - The HTML Presentation Framework




                                    SSH TO THE CLOUD
                                          FIND YOUR APP'S SSH ADDRESS
                          rcapso prs
                          h p hw ak


                                          SSH IN TO YOUR OPENSHIFT GEAR
                          rcsh- APNM
                          h s a P_AE




ryanjarvinen.com/presentations/parks/#/                                                          38/45
3/11/13                                   reveal.js - The HTML Presentation Framework




                  IMPORTING YOUR DATA
                          mnomot- prs- prpit -tp jo -fl $PNHF_
                          ogipr d ak c akons -ye sn -ie OESITR
                          EODRprcodjo - $PNHF_OGD_BHS - amn-
                          P_I/akor.sn h OESITMNOBD_OT u di p
                          $PNHF_OGD_BPSWR
                           OESITMNOBD_ASOD




ryanjarvinen.com/presentations/parks/#/                                                 39/45
3/11/13                                      reveal.js - The HTML Presentation Framework




                               ADDING A 2D INDEX
                                          CONNECT TO MONGODB CLI
                          mno
                          og

                                          SELECT YOUR COLLECTION
                          ueprs
                          s ak

                                             ADD THE 2D INDEX
                          d.akonsesrIdx{ps:2")
                          bprpit.nuene("o""d};




ryanjarvinen.com/presentations/parks/#/                                                    40/45
3/11/13                                         reveal.js - The HTML Presentation Framework




                                          SPATIAL QUERIES
                                              FINDING POINTS NEAR …
                          d.akonsfn("o":{"na":[3,4]};
                          bprpit.id{ps    $er  -7 1})

                                              FIND BY NAME (REGEX)
                          d.akonsfn({Nm :/icl/,ps:{$er:[3,1
                           bprpit.id  ae  lnoni o  na   -74]
                          } )
                           } ;

                                                        GEONEAR
                          d.uCmad{goer:"akons,na :[3,1,nm:1
                          brnomn( eNa  prpit" er  -74] u   0
                          };
                          )




ryanjarvinen.com/presentations/parks/#/                                                       41/45
3/11/13                                               reveal.js - The HTML Presentation Framework




                                 ADDING CHECK-INS
                                      CREATE A NEW COLLECTION FROM SCRATCH
                          d.raeolcin"hci";
                          bcetCleto(cekn)
                          d.hci.nuene({"o":"d })
                          bceknesrIdx  ps   2"  ;


                                                 INSERT A NEW RECORD
                          d.hci.net{"rae":nwDt(,"oe":'utlne
                           bceknisr( cetd  e ae) Nts js add
                          ' "o":[7.32,2.32]}
                           , ps  -670  553  )


                                          QUICK QUERY TO MAKE SURE IT WORKED
                          d.hci.id {ps:{$er:[3,1 }})
                          bceknfn(   o   na  -74]




ryanjarvinen.com/presentations/parks/#/                                                             42/45
3/11/13                                                reveal.js - The HTML Presentation Framework




                         ADD A SECOND DOCUMENT CLOSER TO QUERY POINT
                           THIS IS AN UPSERT - SINCE WE DON'T PASS IN THE _ID IT CREATES A NEW RECORD
                          d.hci.ae{cetd:nwDt(,Nts 'htwsabgse
                          bceknsv( rae   e ae) oe: ta a  i t
                          p,ps:[3.32,4.32])
                          ' o   -770  053 };


                                          ONE WAY TO UPDATE ORIGINAL DOCUMENT
                          mDc=d.hci.idn(_d:OjcI(5108af52806
                          yo   bceknfnOe{i   betd"03de863e32b
                          c"};
                          1))
                          mDcNts="elytelnig;
                          yo.oe   ral h adn"
                          d.hci.aemDc;
                          bceknsv(yo)




ryanjarvinen.com/presentations/parks/#/                                                                 43/45
3/11/13                                      reveal.js - The HTML Presentation Framework




                                          CONCLUSIONS
             1. Spatial on MongoDB is easy and fun
             2. You can now build your own FourSquare or other
                checkin application.
             3. You can also build your own field data entry system.
             4. You can build and deploy your application quickly
                without having to think about infrastructure.




ryanjarvinen.com/presentations/parks/#/                                                    44/45
3/11/13                                            reveal.js - The HTML Presentation Framework




                                             Thanks for following along!
                                                      --ryanj
                                          Signup Code: MONGOLA2013 /




ryanjarvinen.com/presentations/parks/#/                                                          45/45

More Related Content

Similar to Building spatial back-ends with node.js and MongoDB

Building Social IDC Bots with Node.js and MongoDB
Building Social IDC Bots with Node.js and MongoDBBuilding Social IDC Bots with Node.js and MongoDB
Building Social IDC Bots with Node.js and MongoDBMongoDB
 
FRENDS의 시작
FRENDS의 시작FRENDS의 시작
FRENDS의 시작frendskr
 
Building Rich Applications with Appcelerator
Building Rich Applications with AppceleratorBuilding Rich Applications with Appcelerator
Building Rich Applications with AppceleratorMatt Raible
 
JavaScript Presentation Frameworks and Libraries
JavaScript Presentation Frameworks and LibrariesJavaScript Presentation Frameworks and Libraries
JavaScript Presentation Frameworks and LibrariesOleksii Prohonnyi
 
REST for .NET - Introduction to ASP.NET Web API
REST for .NET - Introduction to ASP.NET Web APIREST for .NET - Introduction to ASP.NET Web API
REST for .NET - Introduction to ASP.NET Web APITomas Jansson
 
Web Apps and more
Web Apps and moreWeb Apps and more
Web Apps and moreYan Shi
 
Web app and more
Web app and moreWeb app and more
Web app and morefaming su
 
Introduction to the azure service bus eai edi features
Introduction to the azure service bus eai edi featuresIntroduction to the azure service bus eai edi features
Introduction to the azure service bus eai edi featuresSandro Pereira
 
Single page applications mit asp.net mvc und der asp.net web api
Single page applications mit asp.net mvc und der asp.net web apiSingle page applications mit asp.net mvc und der asp.net web api
Single page applications mit asp.net mvc und der asp.net web apiAlexander Zeitler
 
2012-04-18-shibuyarb-offline-mobile-app-has-great-potential
2012-04-18-shibuyarb-offline-mobile-app-has-great-potential2012-04-18-shibuyarb-offline-mobile-app-has-great-potential
2012-04-18-shibuyarb-offline-mobile-app-has-great-potentialKenichi Murahashi
 
Extending XForms with Server-Side Functionality
Extending XForms with Server-Side FunctionalityExtending XForms with Server-Side Functionality
Extending XForms with Server-Side FunctionalityMarkku Laine
 
Pluggable visualisation of moodle datasets using native browser technologies ...
Pluggable visualisation of moodle datasets using native browser technologies ...Pluggable visualisation of moodle datasets using native browser technologies ...
Pluggable visualisation of moodle datasets using native browser technologies ...Ireland & UK Moodlemoot 2012
 
"Full Stack Web Developer" or "Delphi (and RDBMS) Developer"?
"Full Stack Web Developer" or "Delphi (and RDBMS) Developer"?"Full Stack Web Developer" or "Delphi (and RDBMS) Developer"?
"Full Stack Web Developer" or "Delphi (and RDBMS) Developer"?David Lipschitz
 
CodeFest 2012. Петунин Д. — Идеальные инструменты для разработки на HTML5
CodeFest 2012. Петунин Д. — Идеальные инструменты для разработки на HTML5CodeFest 2012. Петунин Д. — Идеальные инструменты для разработки на HTML5
CodeFest 2012. Петунин Д. — Идеальные инструменты для разработки на HTML5CodeFest
 
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考える
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考えるIt is not HTML5. but ... / HTML5ではないサイトからHTML5を考える
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考えるSadaaki HIRAI
 

Similar to Building spatial back-ends with node.js and MongoDB (20)

Building Social IDC Bots with Node.js and MongoDB
Building Social IDC Bots with Node.js and MongoDBBuilding Social IDC Bots with Node.js and MongoDB
Building Social IDC Bots with Node.js and MongoDB
 
HTML5 Intro
HTML5 IntroHTML5 Intro
HTML5 Intro
 
FRENDS의 시작
FRENDS의 시작FRENDS의 시작
FRENDS의 시작
 
Building Rich Applications with Appcelerator
Building Rich Applications with AppceleratorBuilding Rich Applications with Appcelerator
Building Rich Applications with Appcelerator
 
JavaScript Presentation Frameworks and Libraries
JavaScript Presentation Frameworks and LibrariesJavaScript Presentation Frameworks and Libraries
JavaScript Presentation Frameworks and Libraries
 
de:code エスキュービズム勉強会0620
de:code エスキュービズム勉強会0620de:code エスキュービズム勉強会0620
de:code エスキュービズム勉強会0620
 
REST for .NET - Introduction to ASP.NET Web API
REST for .NET - Introduction to ASP.NET Web APIREST for .NET - Introduction to ASP.NET Web API
REST for .NET - Introduction to ASP.NET Web API
 
Introduction to html5
Introduction to html5Introduction to html5
Introduction to html5
 
Web Apps and more
Web Apps and moreWeb Apps and more
Web Apps and more
 
Web app and more
Web app and moreWeb app and more
Web app and more
 
Introduction to the azure service bus eai edi features
Introduction to the azure service bus eai edi featuresIntroduction to the azure service bus eai edi features
Introduction to the azure service bus eai edi features
 
Single page applications mit asp.net mvc und der asp.net web api
Single page applications mit asp.net mvc und der asp.net web apiSingle page applications mit asp.net mvc und der asp.net web api
Single page applications mit asp.net mvc und der asp.net web api
 
2012-04-18-shibuyarb-offline-mobile-app-has-great-potential
2012-04-18-shibuyarb-offline-mobile-app-has-great-potential2012-04-18-shibuyarb-offline-mobile-app-has-great-potential
2012-04-18-shibuyarb-offline-mobile-app-has-great-potential
 
lecture5
lecture5lecture5
lecture5
 
lecture5
lecture5lecture5
lecture5
 
Extending XForms with Server-Side Functionality
Extending XForms with Server-Side FunctionalityExtending XForms with Server-Side Functionality
Extending XForms with Server-Side Functionality
 
Pluggable visualisation of moodle datasets using native browser technologies ...
Pluggable visualisation of moodle datasets using native browser technologies ...Pluggable visualisation of moodle datasets using native browser technologies ...
Pluggable visualisation of moodle datasets using native browser technologies ...
 
"Full Stack Web Developer" or "Delphi (and RDBMS) Developer"?
"Full Stack Web Developer" or "Delphi (and RDBMS) Developer"?"Full Stack Web Developer" or "Delphi (and RDBMS) Developer"?
"Full Stack Web Developer" or "Delphi (and RDBMS) Developer"?
 
CodeFest 2012. Петунин Д. — Идеальные инструменты для разработки на HTML5
CodeFest 2012. Петунин Д. — Идеальные инструменты для разработки на HTML5CodeFest 2012. Петунин Д. — Идеальные инструменты для разработки на HTML5
CodeFest 2012. Петунин Д. — Идеальные инструменты для разработки на HTML5
 
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考える
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考えるIt is not HTML5. but ... / HTML5ではないサイトからHTML5を考える
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考える
 

More from MongoDB

MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB
 
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!MongoDB
 
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...MongoDB
 
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDBMongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDBMongoDB
 
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...MongoDB
 
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB
 
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 MongoDB SoCal 2020: MongoDB Atlas Jump Start MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB SoCal 2020: MongoDB Atlas Jump StartMongoDB
 
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]MongoDB
 
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2MongoDB
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB
 
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!MongoDB
 
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your MindsetMongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your MindsetMongoDB
 
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas JumpstartMongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas JumpstartMongoDB
 
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...MongoDB
 
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++MongoDB
 
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...MongoDB
 
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep DiveMongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep DiveMongoDB
 
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & GolangMongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & GolangMongoDB
 
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...MongoDB
 
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...MongoDB
 

More from MongoDB (20)

MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
 
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
 
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
 
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDBMongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
 
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
 
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
 
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 MongoDB SoCal 2020: MongoDB Atlas Jump Start MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
 
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
 
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
 
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your MindsetMongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
 
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas JumpstartMongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
 
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
 
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
 
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
 
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep DiveMongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
 
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & GolangMongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
 
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
 
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
 

Building spatial back-ends with node.js and MongoDB

  • 1. 3/11/13 reveal.js - The HTML Presentation Framework BUILDING SPATIAL BACK-ENDS with node.js and MongoDB bit.ly/WUXJWD ryanjarvinen.com/presentations/parks/#/ 1/45
  • 2. 3/11/13 reveal.js - The HTML Presentation Framework presented by ryan jarvinen / @ryanj ryanjarvinen.com/presentations/parks/#/ 2/45
  • 3. 3/11/13 reveal.js - The HTML Presentation Framework Open Platform Evangelist at Red Hat ryanj@redhat.com ryanjarvinen.com/presentations/parks/#/ 3/45
  • 4. 3/11/13 reveal.js - The HTML Presentation Framework AGENDA Learn some basic spatial Load spatial data into MongoDB Run a query or two Go live with a Mongo-powered spatial app in ~30 mins ryanjarvinen.com/presentations/parks/#/ 4/45
  • 5. 3/11/13 reveal.js - The HTML Presentation Framework CODE DU JOUR https://github.com/openshift/openshift-mongo-node- express-example Signup with Code - MONGOLA2013 ryanjarvinen.com/presentations/parks/#/ 5/45
  • 6. 3/11/13 reveal.js - The HTML Presentation Framework THE CLOUD IS A FREE-MARKET FOR ONLINE SERVICES ryanjarvinen.com/presentations/parks/#/ 6/45
  • 7. 3/11/13 reveal.js - The HTML Presentation Framework THE CLOUD LANDSCAPE ryanjarvinen.com/presentations/parks/#/ 7/45
  • 8. 3/11/13 reveal.js - The HTML Presentation Framework ryanjarvinen.com/presentations/parks/#/ 8/45
  • 9. 3/11/13 reveal.js - The HTML Presentation Framework THE BIG PICTURE ryanjarvinen.com/presentations/parks/#/ 9/45
  • 10. 3/11/13 reveal.js - The HTML Presentation Framework ryanjarvinen.com/presentations/parks/#/ 10/45
  • 11. 3/11/13 reveal.js - The HTML Presentation Framework OPENSTACK IS OPEN and FOCUSED ON IAAS ryanjarvinen.com/presentations/parks/#/ 11/45
  • 12. 3/11/13 reveal.js - The HTML Presentation Framework PUBLIC CLOUD + PRIVATE CLOUD = HYBRID CLOUD ryanjarvinen.com/presentations/parks/#/ 12/45
  • 13. 3/11/13 reveal.js - The HTML Presentation Framework OPENSHIFT IS… OPEN ryanjarvinen.com/presentations/parks/#/ 13/45
  • 14. 3/11/13 reveal.js - The HTML Presentation Framework OPEN CARTRIDGE FORMAT ryanjarvinen.com/presentations/parks/#/ 14/45
  • 15. 3/11/13 reveal.js - The HTML Presentation Framework OPEN SOURCE OPENSHIFT ORIGIN ryanjarvinen.com/presentations/parks/#/ 15/45
  • 16. 3/11/13 reveal.js - The HTML Presentation Framework HOSTING OPTIONS DIY OPENSHIFT ONLINE OPENSHIFT ENTERPRISE ryanjarvinen.com/presentations/parks/#/ 16/45
  • 17. 3/11/13 reveal.js - The HTML Presentation Framework DEVELOPER PREVIEW Make sure that you sign up for a free OpenShift account http://openshift.redhat.com/ Free-as-in-beer Free-as-in-freedom 512 MB RAM / 1 GB storage per gears (3 free) Need more resources, just ask! REALLY a Developer Preview ryanjarvinen.com/presentations/parks/#/ 17/45
  • 18. 3/11/13 reveal.js - The HTML Presentation Framework GETTING STARTED WITH OPENSHIFT PRE-REQUISITES: ruby, rubygems git ryanjarvinen.com/presentations/parks/#/ 18/45
  • 19. 3/11/13 reveal.js - The HTML Presentation Framework INSTALLING THE 'RHC' CLIENT TOOL sd gmisalrc uo e ntl h and install node.js ryanjarvinen.com/presentations/parks/#/ 19/45
  • 20. 3/11/13 reveal.js - The HTML Presentation Framework HELP WITH CLIENT TOOLS Openshift Getting Started guide RHC client tools installation ryanjarvinen.com/presentations/parks/#/ 20/45
  • 21. 3/11/13 reveal.js - The HTML Presentation Framework CONFIGURING YOUR DEV ENVIRONMENT rcstp h eu sets your openshift email address verifies your ssh key configuration selects your application namespace ryanjarvinen.com/presentations/parks/#/ 21/45
  • 22. 3/11/13 reveal.js - The HTML Presentation Framework MONGODB SPATIAL ryanjarvinen.com/presentations/parks/#/ 22/45
  • 23. 3/11/13 reveal.js - The HTML Presentation Framework SPATIAL NOTES MongoDB currently supports the following types of spatial queries: 1. Near 2. Containment MongoDB GIS summary: http://www.mongodb.org/display/DOCS/Geospatial+Indexing ryanjarvinen.com/presentations/parks/#/ 23/45
  • 24. 3/11/13 reveal.js - The HTML Presentation Framework MONGODB ASSUMPTIONS Assumes coords. are between -180 and 180 Can handle any 2D coordinates Has methods to handle curvature of the earth (spherical) ryanjarvinen.com/presentations/parks/#/ 24/45
  • 25. 3/11/13 reveal.js - The HTML Presentation Framework MAKING IT WORK 1. Put your data in an array {lc:[5 ,3 ]}/SGETDOTO o 0 0 /UGSE PIN {lc:{x:5 ,y:3 }} o 0 0 {lc:{fo:5 ,y:3 }} o o 0 0 {lc:{ln:4.307 lt 7.994}} o o 0793, a: 3926 2. Add a 2d index to your collection d.lcsesrIdx {lc:"d }) bpae.nuene( o 2" ryanjarvinen.com/presentations/parks/#/ 25/45
  • 26. 3/11/13 reveal.js - The HTML Presentation Framework GEARING UP A NEW APP ON OPENSHIFT rcapcet APNM APCRRDE h p rae P_AE P_ATIG or rcapcet prsndj mnob22-fo-oehts/gtu h p rae ak oes ogd-. -rmcd=tp:/ihb .o/pnhf/pnhf-og-oeepeseapegt cmoesitoesitmnond-xrs-xml.i ryanjarvinen.com/presentations/parks/#/ 26/45
  • 27. 3/11/13 reveal.js - The HTML Presentation Framework ApiainOtos plcto pin ---------- --------- Nmsae raj aepc: yn Crrde:ndj-.,mnob22 atigs oes06 ogd-. Suc Cd:hts/gtu.o/pnhf/pnhf-og-oee ore oe tp:/ihbcmoesitoesitmnond- xrs-xml.i peseapegt Ga Sz: dfut er ie eal Saig cln: no Cetn apiain'ak'..dn raig plcto prs . oe Wiigfryu DSnm t b aalbe..dn atn o or N ae o e vial . oe DwlaigteapiainGtrpstr .. onodn h plcto i eoioy . Coigit 'ak'. lnn no prs.. ryanjarvinen.com/presentations/parks/#/ 27/45
  • 28. 3/11/13 reveal.js - The HTML Presentation Framework prs@ht:/ak-yn.hlu.o/(ud 2980b84688 ak tp/prsrajrcodcm ui: 5134fd0e9 0ae4030 21626a) -------------------------- ------------------------- Cetd rae: 1:3P 02 M Ga Sz:sal er ie ml GtUL i R: sh/2980b8468821626a@ak-yn.hlu.o// s:/5134fd0e90ae4030prsrajrcodcm~g i/ak.i/ tprsgt SH S: 2980b8468821626a@ak-yn.hlu. 5134fd0e90ae4030prsrajrcod cm o ndj-. (oej 06 oes06 Nd.s .) ------------ ------------ RSL: EUT Apiainprswscetd plcto ak a rae. ryanjarvinen.com/presentations/parks/#/ 28/45
  • 29. 3/11/13 reveal.js - The HTML Presentation Framework Adn mnob22t apiain'ak'..Sces dig ogd-. o plcto prs . ucs mnob22(ogD NSLDtbs 22 ogd-. MnoB oQ aaae .) -------------------- -------------------- Cneto UL mnob/1761219207 oncin R: ogd:/2..0.2:71/ Dtbs Nm: prs aaae ae ak Pswr: asod TxwiZG 5JCDYn Uenm: srae amn di RSL: EUT Addmnob22t apiainprs de ogd-. o plcto ak ryanjarvinen.com/presentations/parks/#/ 29/45
  • 30. 3/11/13 reveal.js - The HTML Presentation Framework SUCCESS! You now have a basic node.js app up an running on OpenShift! Your gear is now configured with: it's own git repo it's own web server MongoDB ssh access logging publicly accessible DNS ryanjarvinen.com/presentations/parks/#/ 30/45
  • 31. 3/11/13 reveal.js - The HTML Presentation Framework BUILDING YOUR APP c prs d ak ryanjarvinen.com/presentations/parks/#/ 31/45
  • 32. 3/11/13 reveal.js - The HTML Presentation Framework SETTING UP MONGODB ON OPENSHIFT rccrrdeadmnob22 h atig d ogd-. ryanjarvinen.com/presentations/parks/#/ 32/45
  • 33. 3/11/13 reveal.js - The HTML Presentation Framework INSTALLING DEPENDENCIES Using Node's npm package manager : nmisalmnos- p ntl ogj S Include the - flag in order to save this dependency to S your application's p c a e j o file. akg.sn http://npmjs.org/package/mongojs/ ryanjarvinen.com/presentations/parks/#/ 33/45
  • 34. 3/11/13 reveal.js - The HTML Presentation Framework COMMITTING YOUR CHANGES gtadpcaejo sre.s i d akg.sn evrj Commit your changes locally gtcmi - 'digmnosnmdpnec,iiilzn mnos i omt m adn ogj p eedny ntaiig ogj lbay adn abscAI irr, dig ai P' ryanjarvinen.com/presentations/parks/#/ 34/45
  • 35. 3/11/13 reveal.js - The HTML Presentation Framework DEPLOYMENT gtps i uh Done!Your spatial app should now be live IN THE CLOUD! ryanjarvinen.com/presentations/parks/#/ 35/45
  • 36. 3/11/13 reveal.js - The HTML Presentation Framework ROCKMONGO ON OPENSHIFT rccrrdeadrcmno11 h atig d okog-. (optional) ryanjarvinen.com/presentations/parks/#/ 36/45
  • 37. 3/11/13 reveal.js - The HTML Presentation Framework CONNECTING TO MONGODB vrmnos=rqie'ogj'; a ogj eur(mnos) vrcneto_tig=btnm; a oncinsrn o_ae i(rcs.n.PNHF_OGD_BPSWR) fpoesevOESITMNOBD_ASOD{ cneto_tig=poesevOESITMNOBD_SRAE+ oncinsrn rcs.n.PNHF_OGD_BUENM ""+ : poesevOESITMNOBD_ASOD+""+ rcs.n.PNHF_OGD_BPSWR @ poesevOESITMNOBD_OT+''+ rcs.n.PNHF_OGD_BHS / poesevOESITAPNM; rcs.n.PNHF_P_AE } vrd =mnoscneto_tig [soeor') a b ogj(oncinsrn, 'crbad]; ryanjarvinen.com/presentations/parks/#/ 37/45
  • 38. 3/11/13 reveal.js - The HTML Presentation Framework SSH TO THE CLOUD FIND YOUR APP'S SSH ADDRESS rcapso prs h p hw ak SSH IN TO YOUR OPENSHIFT GEAR rcsh- APNM h s a P_AE ryanjarvinen.com/presentations/parks/#/ 38/45
  • 39. 3/11/13 reveal.js - The HTML Presentation Framework IMPORTING YOUR DATA mnomot- prs- prpit -tp jo -fl $PNHF_ ogipr d ak c akons -ye sn -ie OESITR EODRprcodjo - $PNHF_OGD_BHS - amn- P_I/akor.sn h OESITMNOBD_OT u di p $PNHF_OGD_BPSWR OESITMNOBD_ASOD ryanjarvinen.com/presentations/parks/#/ 39/45
  • 40. 3/11/13 reveal.js - The HTML Presentation Framework ADDING A 2D INDEX CONNECT TO MONGODB CLI mno og SELECT YOUR COLLECTION ueprs s ak ADD THE 2D INDEX d.akonsesrIdx{ps:2") bprpit.nuene("o""d}; ryanjarvinen.com/presentations/parks/#/ 40/45
  • 41. 3/11/13 reveal.js - The HTML Presentation Framework SPATIAL QUERIES FINDING POINTS NEAR … d.akonsfn("o":{"na":[3,4]}; bprpit.id{ps $er -7 1}) FIND BY NAME (REGEX) d.akonsfn({Nm :/icl/,ps:{$er:[3,1 bprpit.id ae lnoni o na -74] } ) } ; GEONEAR d.uCmad{goer:"akons,na :[3,1,nm:1 brnomn( eNa prpit" er -74] u 0 }; ) ryanjarvinen.com/presentations/parks/#/ 41/45
  • 42. 3/11/13 reveal.js - The HTML Presentation Framework ADDING CHECK-INS CREATE A NEW COLLECTION FROM SCRATCH d.raeolcin"hci"; bcetCleto(cekn) d.hci.nuene({"o":"d }) bceknesrIdx ps 2" ; INSERT A NEW RECORD d.hci.net{"rae":nwDt(,"oe":'utlne bceknisr( cetd e ae) Nts js add ' "o":[7.32,2.32]} , ps -670 553 ) QUICK QUERY TO MAKE SURE IT WORKED d.hci.id {ps:{$er:[3,1 }}) bceknfn( o na -74] ryanjarvinen.com/presentations/parks/#/ 42/45
  • 43. 3/11/13 reveal.js - The HTML Presentation Framework ADD A SECOND DOCUMENT CLOSER TO QUERY POINT THIS IS AN UPSERT - SINCE WE DON'T PASS IN THE _ID IT CREATES A NEW RECORD d.hci.ae{cetd:nwDt(,Nts 'htwsabgse bceknsv( rae e ae) oe: ta a i t p,ps:[3.32,4.32]) ' o -770 053 }; ONE WAY TO UPDATE ORIGINAL DOCUMENT mDc=d.hci.idn(_d:OjcI(5108af52806 yo bceknfnOe{i betd"03de863e32b c"}; 1)) mDcNts="elytelnig; yo.oe ral h adn" d.hci.aemDc; bceknsv(yo) ryanjarvinen.com/presentations/parks/#/ 43/45
  • 44. 3/11/13 reveal.js - The HTML Presentation Framework CONCLUSIONS 1. Spatial on MongoDB is easy and fun 2. You can now build your own FourSquare or other checkin application. 3. You can also build your own field data entry system. 4. You can build and deploy your application quickly without having to think about infrastructure. ryanjarvinen.com/presentations/parks/#/ 44/45
  • 45. 3/11/13 reveal.js - The HTML Presentation Framework Thanks for following along! --ryanj Signup Code: MONGOLA2013 / ryanjarvinen.com/presentations/parks/#/ 45/45