NEW
Font size
WorksheetsNGT 6th chap
Total questions: 37
Worksheet time: 19mins
CRUD
Create, Read, Update, and Delete
Create, Real, Update, and Delete
Create, Read, Update, and Detect
Cancel, Read, Update, and Delete
Importing CSV file
Mongoimport --db_name --col_name --CSV --ffile_path --headerline
mongoimport --db db_name --collection col_name --type
CSV --file file_path --headerline
Mongoimport --db db_name --collection col_name --type
CSV --file file_path --headerline
MongoImport --db db_name --collection col_name --type
CSV --file file_path --headerline
See the list of Database
show dbs
show db
use dbs
use db
Drop database
db.dropDatabase()
dropDatabase(db)
db.drop()
dropdatabase(db)
Creating a new collection named products
products = new Collection()
products.createCollection()
db.CreateCollection("products")
db.createCollection("products")
Insert a document in products collection
db.products.insert(name:"Hello world")
db.products.insert({"name":"Hello world"})
db.collection(products).insert({name:"Hello world"})
db.collection("products").insert({name:"Hello world"})
Retrieve all entries from database of roll number 8
db.student.find({"roll_no": "8"})
db.student.find({"roll_no": 8})
db.student.Find({"roll_no": 8})
db.student.FindAll({"roll_no": 8})
Retrive only the Name and roll_no of all Students with percentage greater than 75
db.students.find({percentage:{$gt:"75"},{"Name":1,"roll_no":1})
db.students.find({percentage:{$gt:"75","Name":1,"roll_no":1})
db.students.find({percentage:($gt:"75"),{"Name":1,"roll_no":1})
db.students.find({percentage:{$gt:75},{"Name":0,"roll_no":0})
Retrive the top 5 scorers in maths using sort() and limit() functions
db.students.find().sort("Maths":-1).limit(5)
db.students.find().sort("Maths":1).Limit(5)
db.students.find().Sort("Maths":1).Limit(5)
db.students.find({"Maths":{$gt}}).sort("Maths":-1).limit(5)
________ method returns the first occurrence in the selection.
limit()
sort()
find()
findOne()
When find() method is called the method returns a ________ object
Array
Document
Cursor
None of the above
Indexes makes retrieving data ________
Faster
Slower
Does not affect retriving
visible
default mongodb index
id
_id
__id
id_
Which is not a type of index
Single key index
Compound index
Unique index
Scalable index
Creating a system index
db.collection.sysindex({"Name"})
db.collection.sysIndex({"Name"})
db.collection.sysindex({"Name":1})
None of the above
Given the following array of roll numbers retrieve the documents: [1,3,5,7]
db.student.find("roll_no":{$in:[1,3,5,7]})
db.student.find("roll_no":{$nin:[1,3,5,7]})
db.student.find("roll_no":$nin:[1,3,5,7])
db.student.find("roll_no":$in:[1,3,5,7])
_______ is a data processing paradigm for condensing large volumes of data into useful aggregated results.
Map-reduce
Map
Reduce
$ag
______ can be used instead of map-Reduce
$group
$aggregate
$ag
$ags
Creating Index Ensures uniqueness
True
False
If you wish to make a non-unique index into a unique index you have to compulsorily drop it and recreate a new index
True
False
JOIN's are not supported in Mongodb
True
False
When you update data in your database, you must ensure that your update either succeeds or fails entirely, never having a “partial success,” and that no other database reader ever sees an incomplete write operation. This is called _______
Atomicity
Isolation
ACID
Duplicity
_______ is inserting related documents into a single document.
Referencing
Embeding
Mixing
Sharding
________ is storing related documents into different documents and linking them using _id
Refrencing
Sharding
Objecting
Embedding
Embedding results in _______
data isolation
data atomicity
increasing data redundancy
removing data redundancy
Referencing results in _______
data redundancy
data isolation
removing data redundancy
data atomicity
Normal form in SQL is equivalent to ________ concept in MongoDB
Refrencing
Embeding
Sharding
Manormalization
A table in SQL is equivalent to a _______ in MongoDB
Document
Collection
Database
Shard
A row in SQL is equivalent to a _______ in MongoDB
Document
Collection
Database
Shard
Mongodb documents have a hard size limit of ______
8 MB
16 MB
32 MB
128 MB
Storage of database is not dependent on which of the following factors
Sharding
A Large Number of Collection
Data Life Cycle Management
Data retrieval queries
This feature needs to be used if your application has datasets that need to be persisted in the database only for a limited time period.
Data Isolation
Data Lifecycle Management
Data Shading
Data Refrencing
Minimum data space required by each index
8 KB
1 KB
4 KB
0 KB
_____ are beneficial for collections with heavy read operations such as where the proportion of read-to-write operations is high
Indexes
Isolations
Refrences
Data redundancy
The un-indexed read operations are affected by an index.
True
False
Partitioning Data is called
Sharding
Redundancy
Reduction
Atomicity
The _id does not require any minimum data space.
True
False
