Professional Documents
Culture Documents
A. Shoes
a) Women’s shoes
1. High heels
2. Bellies
b) Men’s shoes
1. Sports shoes
2. Sneakers
b. Relational database
1) This database is based on the relational
data model, which stores data in the form
of rows and columns
2) These rows and column together forms a
table (relation)
3) Many modern database systems like MS
SQL server, oracle, MySQL, and MS
access use RDBMS
4) Relational database management systems
that uses SQL are schema – oriented i.e.
the structure of the data should be known
in advance
- NoSQL databases
a. NoSQL databases are the databases that do
not use SQL as their primary data access
language
b. NoSQL database does not have predefined
schemas like RDBMS, which makes NoSQL
database a perfect candidate for rapidly
changing development environments
c. NoSQL allows developers to make changes
on the fly without affecting applications
d. In short NoSQL is like your favourite
superhero who is not needed to abide by the
traditional database laws. And it makes and
follows laws of its own
e. There are various sub – types of NoSQL
database, out of which MongoDB is based on
document type NoSQL database
f. So coming to document databases
(documentdb), they are NoSQL databases that
store data in the form of documents, each
document represents the data, its relationship
between other data elements, and attributes of
data.
g. Document database store data in a key value
form
car=“Mercedes”
mongod {
name: ‘Jane’,
4. To enter the MongoDB shell, use the result: ‘Pass’,
command score: ‘85’,
}
mongo
Explanation:
5. And you are up and running with MongoDB. The above document contains information
We’ll look at how data is stored and accessed of a student named Jane, where her result
in MongoDB and score are mentioned
A document starts and ends with curly
brackets ‘{’ and ‘}’
In this example, there are three keys
namely ‘name’, ‘result’ and ‘score’
Each key has a value associated with it.
these key – value pairs form a basic
document in MongoDB. The values can
be written in single quotes or double
quotes
Whenever there is more than one data that
needs to be entered in a document, we use
a comma to separate the individual data
- MongoDB collection
a. Documents are part of a collection
b. When two or more documents are present in a
file, the file becomes a collection
c. How to name a collection ?
1) Collection names must begin with letters
or an underscore. So you can write a
collection name as “pro_collection” or
“_procollection”
2) A collection name may contain numbers.
So this is also valid as “pro_collection1”
3) You can’t use the “$” character within the
name of a collection. “$” is reserved. So a
collection name like “pro$collection” will
be invalid
4) A collection name must not exceed 128
characters. Nobody likes long names!
JSON and BSON! The difference Time to Create and Drop databases and collections
Syntax :
show dbs
Example
>show dbs
admin 0.000GB
config 0.000GB
local 0.000GB
test 0.000GB
>
>use test_db
>db.dropDatabase()