SlideShare a Scribd company logo
1   #commands for adding spatial data!
 2   !
 3   #Take a look at the file first!
 4   less parkcoord.json!
 5   #get the file on the server!
 6   scp parkcoord.json 0b49d9219f2847c6a236820959f9a@parks-spmongo.rhcloud.com:parks/data/!
 7   !
 8   #ssh into the machine!
 9   ssh 0b49d9219f2847c6a236820959f9a@parks-spmongo.rhcloud.com!
10   !
11   #import into mongo!
12   mongoimport -d parks -c mongosf --type json --file parks/data/parkcoord.json -h $OPENSHIFT_NOSQL_DB_HOST -u admin -p <your
 …   password>!
13   !
14   #open the mongo shell!
15   mongo -u admin -p <your password> $OPENSHIFT_NOSQL_DB_HOST/parks!
16   !
17   #build the index!
18   db.mongosf.ensureIndex({"pos":"2d"});!
19   !
20   #Now some queries!
21   #simple spatial!
22   db.mongosf.find({"pos" : { "$near" : [-37, 41]}});!
23   !
24   #spatial and text query using regex!
25   db.mongosf.find( { Name : /lincoln/i, pos : { $near : [-37,41] }} );!
26   !
27   #geonear TODO!
28   db.runCommand({ geoNear : "mongosf", near : [-37,41], num : 10 });!
29   !
30   !
31   #create a new collection from scratch!
32   db.createCollection("mongosfuserloc");!
33   db.mongosfuserloc.ensureIndex( { pos : "2d" } );!
34   !
35   #insert a new record!
36   db.mongosfuserloc.insert({ "created" : new Date(), "Notes" : 'just landed', "pos" : [-76.7302 , 25.5332 ] })!
37   !   !
38   #quick query to make sure it worked!
39   db.mongosfuserloc.find( { pos : { $near : [-37,41] } } )!
40   !
41   #add a second document closer to query point!
42   #this is an upsert - since we don't pass in the _id it creates a new record!
43   db.mongosfuserloc.save({ created : new Date(), Notes: 'that was a big step', pos : [-37.7302 , 40.5332 ]});!
44   !
45   #one way to update original document!
46   myDoc = db.mongosfuserloc.findOne({_id : ObjectId("ID for the first object")});!
47   myDoc.Notes = "really the landing";!
48   db.mongosfuserloc.save(myDoc);!
49
Ad

Recommended

Spatial MongoDB, Node.JS, and Express - server-side JS for your application
Spatial MongoDB, Node.JS, and Express - server-side JS for your application
Steven Pousty
 
Spatial Mongo and Node.JS on Openshift JS.Everywhere 2012
Spatial Mongo and Node.JS on Openshift JS.Everywhere 2012
Steven Pousty
 
Spatial mongo for PHP and Zend
Spatial mongo for PHP and Zend
Steven Pousty
 
Script for the geomeetup presentation
Script for the geomeetup presentation
Steven Pousty
 
Mongo sf spatialmongo
Mongo sf spatialmongo
Steven Pousty
 
Openshift GeoSpatial Capabilities
Openshift GeoSpatial Capabilities
Steven Pousty
 
OpenShift with Eclipse Tooling - EclipseCon 2012
OpenShift with Eclipse Tooling - EclipseCon 2012
Steven Pousty
 
Free Mongo on OpenShift
Free Mongo on OpenShift
Steven Pousty
 
Spatial script for my JS.Everywhere 2012
Spatial script for my JS.Everywhere 2012
Steven Pousty
 
Bringing Spatial Love to Your Java Application
Bringing Spatial Love to Your Java Application
MongoDB
 
Back to Basics German 3: Einführung in Replica Sets
Back to Basics German 3: Einführung in Replica Sets
MongoDB
 
faastCrystal
faastCrystal
Sachirou Inoue
 
Introduction to Hadoop - FinistJug
Introduction to Hadoop - FinistJug
David Morin
 
Installation of application server 10g in red hat 4
Installation of application server 10g in red hat 4
uzzzle
 
Ruby on embedded devices rug::b Aug 2014
Ruby on embedded devices rug::b Aug 2014
Eno Thierbach
 
Python Dependencies at Beeswax - BazelCon 2019 Lightning Talk - Ron Rothman
Python Dependencies at Beeswax - BazelCon 2019 Lightning Talk - Ron Rothman
Ron Rothman
 
Redis clustering
Redis clustering
Ravi Yasas
 
Infrastructure coders logstash
Infrastructure coders logstash
David Lutz
 
Cloud Firestore – From JSON Deserialization to Object Document Mapping (ODM)
Cloud Firestore – From JSON Deserialization to Object Document Mapping (ODM)
Minh Dao
 
Datafying Bitcoins
Datafying Bitcoins
Tariq Ahmad
 
Make the prompt great again
Make the prompt great again
jtyr
 
Build, Ship, and Run Any App, Anywhere using Docker
Build, Ship, and Run Any App, Anywhere using Docker
Rahulkrishnan R A
 
MessagePack - An efficient binary serialization format
MessagePack - An efficient binary serialization format
Larry Nung
 
Kubernetes - Parte I
Kubernetes - Parte I
Denny Vriesman
 
Hadoop con2016 - Implement Real-time Centralized logging System by Elastic Stack
Hadoop con2016 - Implement Real-time Centralized logging System by Elastic Stack
Len Chang
 
How To Run Mapreduce Jobs In Python
How To Run Mapreduce Jobs In Python
Yi Wang
 
OSS AWS 핸즈온 강의
OSS AWS 핸즈온 강의
Juhong Jung
 
MongoDB 3.0.0 vs 2.6.x vs 2.4.x Benchmark
MongoDB 3.0.0 vs 2.6.x vs 2.4.x Benchmark
承翰 蔡
 
Overview Study on PIC32MX3XX / 4XX 32-Bit Controller
Overview Study on PIC32MX3XX / 4XX 32-Bit Controller
Premier Farnell
 
Rio negro instructivo para presidentes_de_mesa_elecciones_14-06-2015
Rio negro instructivo para presidentes_de_mesa_elecciones_14-06-2015
Dirección Nacional Electoral de Argentina
 

More Related Content

What's hot (20)

Spatial script for my JS.Everywhere 2012
Spatial script for my JS.Everywhere 2012
Steven Pousty
 
Bringing Spatial Love to Your Java Application
Bringing Spatial Love to Your Java Application
MongoDB
 
Back to Basics German 3: Einführung in Replica Sets
Back to Basics German 3: Einführung in Replica Sets
MongoDB
 
faastCrystal
faastCrystal
Sachirou Inoue
 
Introduction to Hadoop - FinistJug
Introduction to Hadoop - FinistJug
David Morin
 
Installation of application server 10g in red hat 4
Installation of application server 10g in red hat 4
uzzzle
 
Ruby on embedded devices rug::b Aug 2014
Ruby on embedded devices rug::b Aug 2014
Eno Thierbach
 
Python Dependencies at Beeswax - BazelCon 2019 Lightning Talk - Ron Rothman
Python Dependencies at Beeswax - BazelCon 2019 Lightning Talk - Ron Rothman
Ron Rothman
 
Redis clustering
Redis clustering
Ravi Yasas
 
Infrastructure coders logstash
Infrastructure coders logstash
David Lutz
 
Cloud Firestore – From JSON Deserialization to Object Document Mapping (ODM)
Cloud Firestore – From JSON Deserialization to Object Document Mapping (ODM)
Minh Dao
 
Datafying Bitcoins
Datafying Bitcoins
Tariq Ahmad
 
Make the prompt great again
Make the prompt great again
jtyr
 
Build, Ship, and Run Any App, Anywhere using Docker
Build, Ship, and Run Any App, Anywhere using Docker
Rahulkrishnan R A
 
MessagePack - An efficient binary serialization format
MessagePack - An efficient binary serialization format
Larry Nung
 
Kubernetes - Parte I
Kubernetes - Parte I
Denny Vriesman
 
Hadoop con2016 - Implement Real-time Centralized logging System by Elastic Stack
Hadoop con2016 - Implement Real-time Centralized logging System by Elastic Stack
Len Chang
 
How To Run Mapreduce Jobs In Python
How To Run Mapreduce Jobs In Python
Yi Wang
 
OSS AWS 핸즈온 강의
OSS AWS 핸즈온 강의
Juhong Jung
 
MongoDB 3.0.0 vs 2.6.x vs 2.4.x Benchmark
MongoDB 3.0.0 vs 2.6.x vs 2.4.x Benchmark
承翰 蔡
 
Spatial script for my JS.Everywhere 2012
Spatial script for my JS.Everywhere 2012
Steven Pousty
 
Bringing Spatial Love to Your Java Application
Bringing Spatial Love to Your Java Application
MongoDB
 
Back to Basics German 3: Einführung in Replica Sets
Back to Basics German 3: Einführung in Replica Sets
MongoDB
 
Introduction to Hadoop - FinistJug
Introduction to Hadoop - FinistJug
David Morin
 
Installation of application server 10g in red hat 4
Installation of application server 10g in red hat 4
uzzzle
 
Ruby on embedded devices rug::b Aug 2014
Ruby on embedded devices rug::b Aug 2014
Eno Thierbach
 
Python Dependencies at Beeswax - BazelCon 2019 Lightning Talk - Ron Rothman
Python Dependencies at Beeswax - BazelCon 2019 Lightning Talk - Ron Rothman
Ron Rothman
 
Redis clustering
Redis clustering
Ravi Yasas
 
Infrastructure coders logstash
Infrastructure coders logstash
David Lutz
 
Cloud Firestore – From JSON Deserialization to Object Document Mapping (ODM)
Cloud Firestore – From JSON Deserialization to Object Document Mapping (ODM)
Minh Dao
 
Datafying Bitcoins
Datafying Bitcoins
Tariq Ahmad
 
Make the prompt great again
Make the prompt great again
jtyr
 
Build, Ship, and Run Any App, Anywhere using Docker
Build, Ship, and Run Any App, Anywhere using Docker
Rahulkrishnan R A
 
MessagePack - An efficient binary serialization format
MessagePack - An efficient binary serialization format
Larry Nung
 
Hadoop con2016 - Implement Real-time Centralized logging System by Elastic Stack
Hadoop con2016 - Implement Real-time Centralized logging System by Elastic Stack
Len Chang
 
How To Run Mapreduce Jobs In Python
How To Run Mapreduce Jobs In Python
Yi Wang
 
OSS AWS 핸즈온 강의
OSS AWS 핸즈온 강의
Juhong Jung
 
MongoDB 3.0.0 vs 2.6.x vs 2.4.x Benchmark
MongoDB 3.0.0 vs 2.6.x vs 2.4.x Benchmark
承翰 蔡
 

Viewers also liked (7)

Overview Study on PIC32MX3XX / 4XX 32-Bit Controller
Overview Study on PIC32MX3XX / 4XX 32-Bit Controller
Premier Farnell
 
Rio negro instructivo para presidentes_de_mesa_elecciones_14-06-2015
Rio negro instructivo para presidentes_de_mesa_elecciones_14-06-2015
Dirección Nacional Electoral de Argentina
 
Curso de alisado brasileño
Curso de alisado brasileño
asunsol
 
Monitor slideshow
Monitor slideshow
fallbrookmedical
 
Trabajo vanesaa beltran
Trabajo vanesaa beltran
vanessabeltran95
 
Np presentación lotus exige gt
Np presentación lotus exige gt
Dolcevitacoruna
 
Proyecto final productos - sede chitre
Proyecto final productos - sede chitre
isaepanama
 
Overview Study on PIC32MX3XX / 4XX 32-Bit Controller
Overview Study on PIC32MX3XX / 4XX 32-Bit Controller
Premier Farnell
 
Curso de alisado brasileño
Curso de alisado brasileño
asunsol
 
Np presentación lotus exige gt
Np presentación lotus exige gt
Dolcevitacoruna
 
Proyecto final productos - sede chitre
Proyecto final productos - sede chitre
isaepanama
 
Ad

Similar to MongoSF - Spatial MongoDB in OpenShift - script file (20)

Spatial script for Spatial mongo for PHP and Zend
Spatial script for Spatial mongo for PHP and Zend
Steven Pousty
 
Spatial script for CIMA
Spatial script for CIMA
Steven Pousty
 
Script for Spatial Mongo
Script for Spatial Mongo
Steven Pousty
 
Spatial script for MongoBoulder
Spatial script for MongoBoulder
Steven Pousty
 
9b. Document-Oriented Databases lab
9b. Document-Oriented Databases lab
Fabio Fumarola
 
Chapman: Building a High-Performance Distributed Task Service with MongoDB
Chapman: Building a High-Performance Distributed Task Service with MongoDB
MongoDB
 
Building Your First MongoDB Application
Building Your First MongoDB Application
Tugdual Grall
 
Apache Hadoop Shell Rewrite
Apache Hadoop Shell Rewrite
Allen Wittenauer
 
Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...
Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...
MongoDB
 
Back to Basics Webinar 2: Your First MongoDB Application
Back to Basics Webinar 2: Your First MongoDB Application
MongoDB
 
Back to Basics Webinar 2 - Your First MongoDB Application
Back to Basics Webinar 2 - Your First MongoDB Application
Joe Drumgoole
 
Introduction to MongoDB
Introduction to MongoDB
Algiers Tech Meetup
 
QA Fes 2016. Ярослав Пернеровский. Не Jav'ой единой. Пример автоматизации тес...
QA Fes 2016. Ярослав Пернеровский. Не Jav'ой единой. Пример автоматизации тес...
QAFest
 
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
MongoDB
 
Building your first application w/mongoDB MongoSV2011
Building your first application w/mongoDB MongoSV2011
Steven Francia
 
はじめてのMongoDB
はじめてのMongoDB
Takahiro Inoue
 
Books
Books
flaglio
 
How to use MongoDB with CakePHP
How to use MongoDB with CakePHP
ichikaway
 
Back to Basics, webinar 2: La tua prima applicazione MongoDB
Back to Basics, webinar 2: La tua prima applicazione MongoDB
MongoDB
 
San Francisco Java User Group
San Francisco Java User Group
kchodorow
 
Spatial script for Spatial mongo for PHP and Zend
Spatial script for Spatial mongo for PHP and Zend
Steven Pousty
 
Spatial script for CIMA
Spatial script for CIMA
Steven Pousty
 
Script for Spatial Mongo
Script for Spatial Mongo
Steven Pousty
 
Spatial script for MongoBoulder
Spatial script for MongoBoulder
Steven Pousty
 
9b. Document-Oriented Databases lab
9b. Document-Oriented Databases lab
Fabio Fumarola
 
Chapman: Building a High-Performance Distributed Task Service with MongoDB
Chapman: Building a High-Performance Distributed Task Service with MongoDB
MongoDB
 
Building Your First MongoDB Application
Building Your First MongoDB Application
Tugdual Grall
 
Apache Hadoop Shell Rewrite
Apache Hadoop Shell Rewrite
Allen Wittenauer
 
Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...
Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...
MongoDB
 
Back to Basics Webinar 2: Your First MongoDB Application
Back to Basics Webinar 2: Your First MongoDB Application
MongoDB
 
Back to Basics Webinar 2 - Your First MongoDB Application
Back to Basics Webinar 2 - Your First MongoDB Application
Joe Drumgoole
 
QA Fes 2016. Ярослав Пернеровский. Не Jav'ой единой. Пример автоматизации тес...
QA Fes 2016. Ярослав Пернеровский. Не Jav'ой единой. Пример автоматизации тес...
QAFest
 
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
MongoDB
 
Building your first application w/mongoDB MongoSV2011
Building your first application w/mongoDB MongoSV2011
Steven Francia
 
はじめてのMongoDB
はじめてのMongoDB
Takahiro Inoue
 
How to use MongoDB with CakePHP
How to use MongoDB with CakePHP
ichikaway
 
Back to Basics, webinar 2: La tua prima applicazione MongoDB
Back to Basics, webinar 2: La tua prima applicazione MongoDB
MongoDB
 
San Francisco Java User Group
San Francisco Java User Group
kchodorow
 
Ad

More from Steven Pousty (12)

APPLICATIONS AND CONTAINERS AT SCALE: OpenShift + Kubernetes + Docker
APPLICATIONS AND CONTAINERS AT SCALE: OpenShift + Kubernetes + Docker
Steven Pousty
 
Introduction to PaaS for application developers
Introduction to PaaS for application developers
Steven Pousty
 
London Cloud Summit 2014 - raising the tide: getting developers in the cloud
London Cloud Summit 2014 - raising the tide: getting developers in the cloud
Steven Pousty
 
Workshop For pycon13
Workshop For pycon13
Steven Pousty
 
Build a PaaS with OpenShift Origin
Build a PaaS with OpenShift Origin
Steven Pousty
 
Monkigras - dropping science on your developer ecosystem
Monkigras - dropping science on your developer ecosystem
Steven Pousty
 
Dropping Science on Your Developer Ecosystem - lessons from Ecosystem Management
Dropping Science on Your Developer Ecosystem - lessons from Ecosystem Management
Steven Pousty
 
Open shift intro for Philly PUG
Open shift intro for Philly PUG
Steven Pousty
 
Open shift intro for Philly PUG
Open shift intro for Philly PUG
Steven Pousty
 
deCarta at BAPI
deCarta at BAPI
Steven Pousty
 
LinuxFest NW - Using Postgis To Add Some Spatial Flavor To Your App
LinuxFest NW - Using Postgis To Add Some Spatial Flavor To Your App
Steven Pousty
 
Using PostGIS To Add Some Spatial Flavor To Your Application
Using PostGIS To Add Some Spatial Flavor To Your Application
Steven Pousty
 
APPLICATIONS AND CONTAINERS AT SCALE: OpenShift + Kubernetes + Docker
APPLICATIONS AND CONTAINERS AT SCALE: OpenShift + Kubernetes + Docker
Steven Pousty
 
Introduction to PaaS for application developers
Introduction to PaaS for application developers
Steven Pousty
 
London Cloud Summit 2014 - raising the tide: getting developers in the cloud
London Cloud Summit 2014 - raising the tide: getting developers in the cloud
Steven Pousty
 
Workshop For pycon13
Workshop For pycon13
Steven Pousty
 
Build a PaaS with OpenShift Origin
Build a PaaS with OpenShift Origin
Steven Pousty
 
Monkigras - dropping science on your developer ecosystem
Monkigras - dropping science on your developer ecosystem
Steven Pousty
 
Dropping Science on Your Developer Ecosystem - lessons from Ecosystem Management
Dropping Science on Your Developer Ecosystem - lessons from Ecosystem Management
Steven Pousty
 
Open shift intro for Philly PUG
Open shift intro for Philly PUG
Steven Pousty
 
Open shift intro for Philly PUG
Open shift intro for Philly PUG
Steven Pousty
 
LinuxFest NW - Using Postgis To Add Some Spatial Flavor To Your App
LinuxFest NW - Using Postgis To Add Some Spatial Flavor To Your App
Steven Pousty
 
Using PostGIS To Add Some Spatial Flavor To Your Application
Using PostGIS To Add Some Spatial Flavor To Your Application
Steven Pousty
 

Recently uploaded (20)

A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
 
Agentic AI for Developers and Data Scientists Build an AI Agent in 10 Lines o...
Agentic AI for Developers and Data Scientists Build an AI Agent in 10 Lines o...
All Things Open
 
9-1-1 Addressing: End-to-End Automation Using FME
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
 
Securing AI - There Is No Try, Only Do!.pdf
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
Lessons Learned from Developing Secure AI Workflows.pdf
Lessons Learned from Developing Secure AI Workflows.pdf
Priyanka Aash
 
cnc-processing-centers-centateq-p-110-en.pdf
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
From Manual to Auto Searching- FME in the Driver's Seat
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
digitaljignect
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
Quantum AI: Where Impossible Becomes Probable
Quantum AI: Where Impossible Becomes Probable
Saikat Basu
 
Techniques for Automatic Device Identification and Network Assignment.pdf
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 
You are not excused! How to avoid security blind spots on the way to production
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
UserCon Belgium: Honey, VMware increased my bill
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
Mastering AI Workflows with FME by Mark Döring
Mastering AI Workflows with FME by Mark Döring
Safe Software
 
The Future of Product Management in AI ERA.pdf
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
10 Key Challenges for AI within the EU Data Protection Framework.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
 
Agentic AI for Developers and Data Scientists Build an AI Agent in 10 Lines o...
Agentic AI for Developers and Data Scientists Build an AI Agent in 10 Lines o...
All Things Open
 
9-1-1 Addressing: End-to-End Automation Using FME
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
 
Securing AI - There Is No Try, Only Do!.pdf
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
Lessons Learned from Developing Secure AI Workflows.pdf
Lessons Learned from Developing Secure AI Workflows.pdf
Priyanka Aash
 
cnc-processing-centers-centateq-p-110-en.pdf
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
From Manual to Auto Searching- FME in the Driver's Seat
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
digitaljignect
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
Quantum AI: Where Impossible Becomes Probable
Quantum AI: Where Impossible Becomes Probable
Saikat Basu
 
Techniques for Automatic Device Identification and Network Assignment.pdf
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 
You are not excused! How to avoid security blind spots on the way to production
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
UserCon Belgium: Honey, VMware increased my bill
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
Mastering AI Workflows with FME by Mark Döring
Mastering AI Workflows with FME by Mark Döring
Safe Software
 
The Future of Product Management in AI ERA.pdf
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
10 Key Challenges for AI within the EU Data Protection Framework.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 

MongoSF - Spatial MongoDB in OpenShift - script file

  • 1. 1 #commands for adding spatial data! 2 ! 3 #Take a look at the file first! 4 less parkcoord.json! 5 #get the file on the server! 6 scp parkcoord.json [email protected]:parks/data/! 7 ! 8 #ssh into the machine! 9 ssh [email protected]! 10 ! 11 #import into mongo! 12 mongoimport -d parks -c mongosf --type json --file parks/data/parkcoord.json -h $OPENSHIFT_NOSQL_DB_HOST -u admin -p <your … password>! 13 ! 14 #open the mongo shell! 15 mongo -u admin -p <your password> $OPENSHIFT_NOSQL_DB_HOST/parks! 16 ! 17 #build the index! 18 db.mongosf.ensureIndex({"pos":"2d"});! 19 ! 20 #Now some queries! 21 #simple spatial! 22 db.mongosf.find({"pos" : { "$near" : [-37, 41]}});! 23 ! 24 #spatial and text query using regex! 25 db.mongosf.find( { Name : /lincoln/i, pos : { $near : [-37,41] }} );! 26 ! 27 #geonear TODO! 28 db.runCommand({ geoNear : "mongosf", near : [-37,41], num : 10 });! 29 ! 30 ! 31 #create a new collection from scratch! 32 db.createCollection("mongosfuserloc");! 33 db.mongosfuserloc.ensureIndex( { pos : "2d" } );! 34 ! 35 #insert a new record! 36 db.mongosfuserloc.insert({ "created" : new Date(), "Notes" : 'just landed', "pos" : [-76.7302 , 25.5332 ] })! 37 ! ! 38 #quick query to make sure it worked! 39 db.mongosfuserloc.find( { pos : { $near : [-37,41] } } )! 40 ! 41 #add a second document closer to query point! 42 #this is an upsert - since we don't pass in the _id it creates a new record! 43 db.mongosfuserloc.save({ created : new Date(), Notes: 'that was a big step', pos : [-37.7302 , 40.5332 ]});! 44 ! 45 #one way to update original document! 46 myDoc = db.mongosfuserloc.findOne({_id : ObjectId("ID for the first object")});! 47 myDoc.Notes = "really the landing";! 48 db.mongosfuserloc.save(myDoc);! 49