Selasa, 03 Oktober 2023
Selasa, 26 September 2023
Mengenal Collection, Perintah Collection dan Contoh, CRUD Document dan Contoh
Mengenal Collection, Perintah Collection dan Contoh, CRUD Document dan Contoh
Collection
Insert Document
● Untuk menyimpan data ke MongoDB, kita perlu membuat document dalam bentuk JSON
● Field _id tidak wajib dimasukkan, jika kita tidak memasukkan field _id, maka secara otomatis MongoDB akan membuat _id baru secara random dengan tipe data ObjectId
● Atau kita juga bisa secara eksplisit membuat ObjectId baru dengan menggunakan perintah “new ObjectId()”
Kuis 1
● Hapus database perpustakaan
● Tampilkan database
● Buat database minimarket
● Buat collection di dalam db minimarket: produk, order, pelanggan
● Tampilkan collection pada db minimarket
● Hapus collection order
● Tampilkan collection pada db minimarket
● Buat database perpustakaan dan collection: buku, kategori, peminjaman
Rabu, 20 September 2023
Variable & Data Type
Variable & Data Type
1- Saving Values
In the first mission, we learned the basics of Python programming and performed a few arithmetical operations using Python. In this mission, we'll learn how to save values, and how to work with numerical and text data.
2. Variables
3- Variable Names
Instructions
In the code editor on the right, we attempted to store 34000 in a variable named old-income, and 40000 in a variable named new income. But both of these variable names cause syntax errors, so we commented-out the code.
Change the variable name old-income to old_income to prevent a syntax error.
Change the variable name new income to new_income to prevent a syntax error.
Remove the # from each line so that the code will run, then run the code.
4. Updating Variables
Instructions
Update the variable income by adding 6000 to its current value.
The variable income is already shown in the code editor on the right.
Print income.
5- Syntax Shortcuts
Instructions
Assign a value of 20 to a variable named variable_1.
Assign a value of 20 to a variable named variable_2.
Update the value of variable_2 by adding 10 to its current value. You can take advantage of the += operator.
Update the value of variable_1 by multiplying its current value by 4. You can take advantage of the *= operator.
Display variable_1 and variable_2 using print().
6- Integers & Floats
Instructions
Assign the integer 10 to a variable named variable_1.
Assign the float 2.5 to a variable named variable_2.
Update the value of variable_1 by adding the float 6.5 to its current value. You can use the += operator.
Update the value of variable_2 by multiplying its current value by the integer 2. You can use the *= operator.
Display variable_1 and variable_2 using print().
7- Conversion Between Types
Instructions
Assign the value 13.9 to a variable named variable_a.
Assign the value 2.8 to a variable named variable_b.
Round variable_a using the round() command, and assign back the rounded value to variable_a.
Convert variable_b from a float to an integer using the int() command, and assign back the converted value to variable_b.
Display variable_a and variable_b using the print() command.
8- Strings
Instructions
Assign the string Pandora - Music & Radio to a variable named app_name.
Assign the string 4.0 to a variable named average_rating. Make sure you don't mistake a string for a float.
Assign the string 1724546 to a variable named total_ratings. Make sure you don't mistake a string for an integer.
Assign the string free to a variable named price.
Display the app_name variable using print().
9- Escaping Special Characters
Instructions
Assign the string Facebook's new motto is "move fast with stable infra." to a variable named motto.
Notice there's a . character at the end of Facebook's new motto is "move fast with stable infra." — you'll need to include the . character in your answer.
Display the variable motto using print() — displaying motto is required for answer checking.
10- String Operations
Instructions
Assign the string Facebook's rating is to a variable named facebook.
Assign the float 3.5 to a variable named fb_rating.
Convert fb_rating from a float to a string using the str() command, and assign the converted value to a new variable named fb_rating_str.
Concatenate the strings stored in facebook and fb_rating_str to form the string Facebook's rating is 3.5.
Assign the concatenated string to a variable named fb.
You'll need to add a space character between Facebook's rating is and 3.5 to avoid ending up with the string Facebook's rating is3.5.
Display the fb variable using print() — this is required for answer checking.
Selasa, 19 September 2023
Apa itu MongoDB
MongoDB adalah sistem manajemen basis data NoSQL yang dikembangkan oleh MongoDB, Inc. Basis data ini dikenal sebagai "NoSQL" karena berbeda dalam hal struktur data dan cara penyimpanan data dibandingkan dengan basis data relasional tradisional (SQL).
Mengapa MongoDB
Skema Dinamis
Basis Data Dokumen
Bahasa Query yang Mudah
Kinerja Tinggi
1. Skalabilitas Horizontal
MongoDB mendukung skalabilitas horizontal, yang memungkinkan Anda menambahkan lebih banyak server (sharding) ketika aplikasi Anda berkembang. Ini memungkinkan sistem MongoDB untuk menangani beban yang meningkat dengan baik.
2. Replikasi Otomatis
Instalasi MongoDB Shell di Windows:
Berikut hapus centang pada kotak jika Anda ingin menginstal shell untuk semua pengguna di mesin lokal Anda dan klik Berikutnya.
-
Membuat Form Login dan Register dengan PHP & My SQL Cara membuat form login dan register Pastikan sudah mengaktifkan XAMPP, Lalu buat ...
-
GETTING STARTED WITH MATPLOTLIB & SEABORN 1. Pertama tama silahakan load data train.csv sehingga seperti dibawah ini 2. Coba tampilkan...
.png)
.png)
.png)
.png)
.png)
.png)
.png)
.png)
.png)
.png)
.png)
.png)

.png)
.jpg)
.png)
.png)
.png)
.png)
.png)
.png)
.png)
.png)
.png)
.png)
.png)
.png)
.png)
.png)
.png)