100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Summary Notes mongodb $3.70
Add to cart

Summary

Summary Notes mongodb

 134 views  4 purchases
  • Course
  • Institution

EDX's MongoDB course summarized with examples of how functions work.

Preview 2 out of 8  pages

  • December 1, 2019
  • 8
  • 2019/2020
  • Summary
avatar-seller
Mongodb compass: visual interface to mongo db
Atlas: mongo’s database as a service

Refering to a collection from database -> database.table
Documents are stored in collections, database can have more collections.

You may use any supported value type for any field value or array elment in a mongodb
document.

MongoDB provides specific support for documents, arrays, and geospatial data.

JSON documents:
- begin and end with { }
- are composed of fields: ​“key”:”value”, /​ / commas seperate the fields
- Arrays are in normal brackets:




ex. {“end station name”Broadway”}
RANGE FILTER
{'birth year': {$gte: 1985,$lt: 1990}} // $gte = greater than or equal to, $lt = less than

CRUD: create, read, update, delete

Replica sets are designed so that if the primary node goes down, one of the other nodes will
step up to take its place so that clients can continue reading and writing data as if nothing
had happened.

insertOne()
1. Select database (use video), via show collections you can see all the databases
2. ex query: db.moviesScratch.insertOne({title: "Star Trek II: The Wrath of Khan", year:
1982, imdb: "tt0084726"})

insertMany() ->
- ORDERED: as soon as an error encouters, insertMany stops inserting:
db​.​moviesScratch​.​insertMany​(
[

, {
​"_id"​ :​ ​"tt0084726"​,
​"title"​ :​ ​"Star Trek II: The Wrath of Khan"​,
​"year"​ :​ ​1982​,
​"type"​ :​ ​"movie"
},
{
​"_id"​ :​ ​"tt0796366"​,
​"title"​ :​ ​"Star Trek"​,
​"year"​ :​ ​2009​,
​"type"​ :​ ​"movie"
},
{
​"_id"​ :​ ​"tt0084726"​,
​"title"​ :​ ​"Star Trek II: The Wrath of Khan"​,
​"year"​ :​ ​1982​,
​"type"​ :​ ​"movie"
},
{
​"_id"​ :​ ​"tt1408101"​,
​"title"​ :​ ​"Star Trek Into Darkness"​,
​"year"​ :​ ​2013​,
​"type"​ :​ ​"movie"
},
{
​"_id"​ :​ ​"tt0117731"​,
​"title"​ :​ ​"Star Trek: First Contact"​,
​"year"​ :​ ​1996​,
​"type"​ :​ ​"movie"
}
],
);



- UNORDERED: continues after getting an error
db​.​moviesScratch​.​insertMany​(
[
{
​"_id"​ :​ ​"tt0084726"​,
​"title"​ :​ ​"Star Trek II: The Wrath of Khan"​,

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller Strazz. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $3.70. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

48298 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 15 years now

Start selling
$3.70  4x  sold
  • (0)
Add to cart
Added