Download presentation
Presentation is loading. Please wait.
Published byDaisy Curtis Modified over 9 years ago
1
SE-2840 Dr. Mark L. Hornick1 MongoDB A persistent data store
2
What is a database? Like a file, a database is used to persistently store information outside of an application The app can stop or crash, but the data persists and is still available after restart Unlike a file, a database is structured, allowing for easy manipulation (CRUD) Create Read Update Delete SE-2840 Dr. Mark L. Hornick2
3
MongoDB stores data JSON db.restaurants.insert( { "address" : { "street" : "2 Avenue", "zipcode" : "10075", "building" : "1480", "coord" : [ -73.9557413, 40.7720266 ], }, "borough" : "Manhattan", "cuisine" : "Italian", "grades" : [ { "date" : "2014-10-01", "grade" : "A"}, { "date" : "2014-01-16", "grade" : "B"} ], "name" : "Vella } ); SE-2840 Dr. Mark L. Hornick3
4
MongoDB stores data JSON var restaurant = { "address" : { "street" : "2 Avenue", "zipcode" : "10075", "building" : "1480", "coord" : [ -73.9557413, 40.7720266 ], }, "borough" : "Manhattan", "cuisine" : "Italian", "grades" : [ { "date" : "2014-10-01", "grade" : "A"}, { "date" : "2014-01-16", "grade" : "B"} ], "name" : "Vella }; db.restaurants.insert( restaurant ); SE-2840 Dr. Mark L. Hornick4
5
Once stored, data can be retrieved through various queries var favorites = db.restaurants.find( {“borough”:”Manhattan”); // favorites is a JSON array of ALL restaurants // in Manhattan SE-2840 Dr. Mark L. Hornick5
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.