Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Summary Notes mongodb

Rating
-
Sold
4
Pages
8
Uploaded on
01-12-2019
Written in
2019/2020

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

Institution
Course

Content preview

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"​,

Written for

Institution
Study
Course

Document information

Uploaded on
December 1, 2019
Number of pages
8
Written in
2019/2020
Type
SUMMARY

Subjects

$4.81
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Strazz Hogeschool Windesheim
Follow You need to be logged in order to follow users or courses
Sold
201
Member since
8 year
Number of followers
186
Documents
8
Last sold
2 year ago
Hoogwaardige CE / ICT samenvattingen

4.0

50 reviews

5
15
4
27
3
5
2
1
1
2

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions