Skip to content

Instantly share code, notes, and snippets.

View chhavi48's full-sized avatar
:octocat:
coding

Chhavi srivastav chhavi48

:octocat:
coding
View GitHub Profile
@chhavi48
chhavi48 / image-editor.markdown
Created September 21, 2022 16:38
image-editor
Terminology
Database A container for collections. This is the same as a database in SQL and
usually each project will have its own database full of different collections.
Collection
A grouping of documents inside of a database. This is the same as a table in
SQL and usually each type of data (users, posts, products) will have its own
collection.
Document
A record inside of a collection. This is the same as a row in SQL and usually
Assignment 2
1.db.assign1.find({"age": { $in: [40]}}).pretty()
2. db.assign1.find({ $all: [{"gender": "Female"}, {"age": {$gte: 20, $lte: 30}}]}).pretty()
3. db.assign1.find({ $and: [{"gender": "Female"}, {"age": {$gte: 20, $lte: 30}}]}).pretty()
1. Database Commands
a.View all databases
show dbs
b.Create a new or switch databases
use dbName
c.View current Database
db