SlideShare uma empresa Scribd logo
1 de 7
Baixar para ler offline
http://www.tutorialspoint.com Copyright © tutorialspoint.com
MONGODB MOCK TEST
MONGODB MOCK TEST
This section presents you various set of Mock Tests related to MongoDB Framework. You can
download these sample mock tests at your local machine and solve offline at your convenience.
Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.
MONGODB MOCK TEST II
MONGODB MOCK TEST II
Q 1 - What does the following MongoDB command return?
db.posts.findlikes: $gt: 100, likes: $lt: 200;
A - Posts with likes greater than 100 but less than 200
B - Posts with likes greater than or equal to 100 but less than or equal to 200
C - Posts with likes less than 200
D - Will return syntax error
Q 2 - Consider that our posts collection contains an array field called tags that
contains tags that the user enters.
{
_id: 1,
tags: ["tutorial", "fun", "learning"],
post_text: "This is my first post",
//other elements of document
}
Which of the following commands will find all the posts that have been tagged as
tutorial?
Q 3 - Which of the following is the most important consideration while designing the
schema for MongoDB?
A - The schema should match the data access and query patterns
B - The schema should be kept in 3NF similar to SQL schemas
C - The schema should focus on creating possible embedded documents
D - The schema should contain maximum indexes
Q 4 - Which of the following operations on a single document will operate atomically?
A - update
B - $push
C - Both a and b
D - None of the above
Q 5 - Which of the following is supported by MongoDB?
A - ACID Transactions
B - Relationships between Collections PrimaryKey − ForeignKey
C - Journaling
D - Transaction Management
Q 6 - Consider that our posts collection contains an array field called tags that
contains tags that the user enters.
{
_id: 1,
tags: ["tutorial", "fun", "learning"],
post_text: "This is my first post",
//other elements of document
}
What does the following command return:
db.posts.find′tags.0′ :" tutorial "
A - All the posts whose tags array contains tutorial
B - All the posts which contains only one tag element in the tag array
C - All the posts having the first element of the tags array as tutorial
D - All the posts which contains 0 or more tags named tutorial
Q 7 - Consider that the posts collection contains an array called ratings which contains
ratings given to the post by various users in the following format:
{
_id: 1,
post_text: "This is my first post",
ratings: [5, 4, 2, 5],
//other elements of document
}
Which of the following query will return all the documents where the array ratings
contains at least one element between 3 and 6?
A - db.inventory.findratings: $elemMatch: $gt: 3, $lt: 6
B - db.inventory.findratings: ratings: $gt: 5, $lt: 9
C - db.inventory.findratings: ratings. $: $gt: 5, $lt: 9
D - db.inventory.findratings: $elemMatch: $gte: 3, $lte: 6
Q 8 - Consider that the posts collection contains an array called ratings which contains
ratings given to the post by various users in the following format:
{
_id: 1,
post_text: "This is my first post",
ratings: [5, 4, 2, 5],
//other elements of document
}
Which of the following query will return all the documents where the ratings array
contains elements that in some combination satisfy the query conditions?
A - db.inventory.findratings: $elemMatch: $gt: 3, $lt: 6
B - db.inventory.findratings: ratings: $gt: 5, $lt: 9
C - db.inventory.findratings: ratings. $: $gt: 5, $lt: 9
D - db.inventory.findratings: $elemMatch: $gte: 3, $lte: 6
Q 9 - Which option should be used to update all the documents with the specified
condition in the MongoDB query?
A - updateAll instead of update
B - specify {multi : true} as the third parameter of update command
C - specify {all: true} as the third parameter of update command
D - specify {updateAll: true} as the third parameter of update command
Q 10 - What does the following query do when performed on the posts collection?
db.posts.updateid: 1, Title: ThisispostwithID1 "
A - Updates the Title of the post
B - Updating a document is possible only with $set
C - Replaces the complete document with _id as 1 with the document specified in second
parameter
D - Syntax error
Q 11 - What does the following query do when performed on the posts collection?
db.posts.updateid: 1, $set: Author:" Tom "
A - Sets the complete document with _id as 1 with the document specified in second parameter
by replacing it completely
B - Adds a new field Author in the searched collection if not already present
C - Updates only the Author field of the document with _id as 1
D - Both b and c
Q 12 - Which option can be used with update command so that a new document gets
created if no matching document is found based on the query condition?
A - Specify {upsert : true } as the third parameter of update command
B - upsert command instead of update command
C - {update: true, insert: true} as the third parameter of update command
D - This has to be handled in application code Node.js, PHP, JAVA, C#, etc. and cannot be handled in
mongo shell query
Q 13 - Consider that you are using { upsert : true } option in your update command.
Which of the following parameters will be used to determine if any new documents
were inserted:
A - nMatched
B - nInserted
C - nModified
D - nUpserted
Q 14 - Which of the following commands removes a single document that matches the
condition that Author is Joe?
D - Both b and c
Q 15 - What is the output of following two commands in MongoDB:
db.posts.insert "id ": 1
db.posts.insert "id ": 1
A - Two documents will be inserted with _id as 1
B - MongoDB will automatically increment the _id of the second document as 2
C - This will throw a duplicate key error
D - It will insert two documents and throw a warning to the user
Q 16 - Which option should be used with findAndModify command to return the
modified document instead of the pre-modification document?
A - findAndModify by default returns the pre-modification document
B - Set {new : true}
C - Use the POST version of findAndModify called findAndModifyPost
D - Both b and c are valid
Q 17 - Consider the following posts document:
{
_id: 1,
post_text: "This is my first post",
author: "Tom",
tags: ["tutorial","quiz","facebook","learning","fun"]
}
Which of the following queries will return the documents but with only the first two
tags in the tags array?
D - Both a and c are valid. $slice works both with projection and limit.
Q 18 - Which are the ONLY ways to project portions of an array?
A - $elemMatch
B - $slice
C - $
D - All of the above
Q 19 - Which of the following operator can be used to limit the number of documents
in an array field of a document after an update is performed?
A - pushalongwitheach, sortandslice
B - $removeFromSet
C - $arrayLimit
D - None of the above
Q 20 - Which of the following methods can be used on a cursor object?
A - cursor.next
B - cursor.hasNext
C - cursor.forEach
D - All of the above
Q 21 - Which language is MongoDB written in?
A - C++
B - Java
C - Python
D - MongoC
Q 22 - Which type of indexes does MongoDB support?
A - Compound Indexes
B - Multikey Indexes
C - Geospatial Indexes
D - All of the above
Q 23 - What does the totalKeysExamined field returned by the explain method
indicate?
A - Number of documents that match the query condition
B - Number of index entries scanned
C - Number of documents scanned
D - Details the completed execution of the winning plan as a tree of stages
Q 24 - If the value of totalKeysExamined is 30000 and the value of totalDocsExamined
is 0, which of the following option is correct?
A - The query used an index to fetch the results
B - The query returned 30000 documents after scanning the documents
C - The query returned 0 documents
D - None of the above
Q 25 - You can implement a multi-document transaction in MongoDB using which of
the following concept?
A - Tailable Cursor
B - Two Phase Commits
C - Compound Indexing
D - Multi Document Transaction is not supported by MongoDB
ANSWER SHEET
ANSWER SHEET
Question Number Answer Key
1 C
2 A
3 A
4 C
5 C
6 C
7 A
8 B
9 B
10 C
11 D
12 A
13 D
14 D
15 C
16 B
17 A
18 D
19 A
20 D
21 A
22 D
23 B
24 A
25 B
Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js

Mais conteúdo relacionado

Mais procurados

Process Scheduler and Balancer in Linux Kernel
Process Scheduler and Balancer in Linux KernelProcess Scheduler and Balancer in Linux Kernel
Process Scheduler and Balancer in Linux KernelHaifeng Li
 
ssh.ppt
ssh.pptssh.ppt
ssh.pptjoekr1
 
02 - Build and Deployment Management
02 - Build and Deployment Management02 - Build and Deployment Management
02 - Build and Deployment ManagementSergii Shmarkatiuk
 
U-boot and Android Verified Boot 2.0
U-boot and Android Verified Boot 2.0U-boot and Android Verified Boot 2.0
U-boot and Android Verified Boot 2.0GlobalLogic Ukraine
 
Android Development Tools Overview
Android Development Tools OverviewAndroid Development Tools Overview
Android Development Tools OverviewMike Wolfson
 
Distributed Compiler Icecc
Distributed Compiler IceccDistributed Compiler Icecc
Distributed Compiler IceccSZ Lin
 
Organizing Machine Learning Projects - Repository Organization
Organizing Machine Learning Projects - Repository OrganizationOrganizing Machine Learning Projects - Repository Organization
Organizing Machine Learning Projects - Repository OrganizationHao-Wen (Herman) Dong
 
Bdd – with cucumber and gherkin
Bdd – with cucumber and gherkinBdd – with cucumber and gherkin
Bdd – with cucumber and gherkinArati Joshi
 
Frida Android run time hooking - Bhargav Gajera & Vitthal Shinde
Frida  Android run time hooking - Bhargav Gajera & Vitthal ShindeFrida  Android run time hooking - Bhargav Gajera & Vitthal Shinde
Frida Android run time hooking - Bhargav Gajera & Vitthal ShindeNSConclave
 
Process Management in Android
Process Management in AndroidProcess Management in Android
Process Management in AndroidShrey Verma
 
Compression Commands in Linux
Compression Commands in LinuxCompression Commands in Linux
Compression Commands in LinuxPegah Taheri
 
Linux Administration
Linux AdministrationLinux Administration
Linux AdministrationHarish1983
 
[KubeConEU2023] Lima pavilion
[KubeConEU2023] Lima pavilion[KubeConEU2023] Lima pavilion
[KubeConEU2023] Lima pavilionAkihiro Suda
 
Advanced file permissions in linux
Advanced file permissions in linuxAdvanced file permissions in linux
Advanced file permissions in linuxMohit Singh
 
How to hack Citrix (So, You Just Inherited Someone Else's Citrix Environment....
How to hack Citrix (So, You Just Inherited Someone Else's Citrix Environment....How to hack Citrix (So, You Just Inherited Someone Else's Citrix Environment....
How to hack Citrix (So, You Just Inherited Someone Else's Citrix Environment....Denis Gundarev
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debugginglibfetion
 

Mais procurados (20)

Process Scheduler and Balancer in Linux Kernel
Process Scheduler and Balancer in Linux KernelProcess Scheduler and Balancer in Linux Kernel
Process Scheduler and Balancer in Linux Kernel
 
ssh.ppt
ssh.pptssh.ppt
ssh.ppt
 
02 - Build and Deployment Management
02 - Build and Deployment Management02 - Build and Deployment Management
02 - Build and Deployment Management
 
Unix - Filters/Editors
Unix - Filters/EditorsUnix - Filters/Editors
Unix - Filters/Editors
 
U-boot and Android Verified Boot 2.0
U-boot and Android Verified Boot 2.0U-boot and Android Verified Boot 2.0
U-boot and Android Verified Boot 2.0
 
Android Development Tools Overview
Android Development Tools OverviewAndroid Development Tools Overview
Android Development Tools Overview
 
Distributed Compiler Icecc
Distributed Compiler IceccDistributed Compiler Icecc
Distributed Compiler Icecc
 
Organizing Machine Learning Projects - Repository Organization
Organizing Machine Learning Projects - Repository OrganizationOrganizing Machine Learning Projects - Repository Organization
Organizing Machine Learning Projects - Repository Organization
 
Bdd – with cucumber and gherkin
Bdd – with cucumber and gherkinBdd – with cucumber and gherkin
Bdd – with cucumber and gherkin
 
Frida Android run time hooking - Bhargav Gajera & Vitthal Shinde
Frida  Android run time hooking - Bhargav Gajera & Vitthal ShindeFrida  Android run time hooking - Bhargav Gajera & Vitthal Shinde
Frida Android run time hooking - Bhargav Gajera & Vitthal Shinde
 
Cucumber presenation
Cucumber presenationCucumber presenation
Cucumber presenation
 
File permissions
File permissionsFile permissions
File permissions
 
Process Management in Android
Process Management in AndroidProcess Management in Android
Process Management in Android
 
Compression Commands in Linux
Compression Commands in LinuxCompression Commands in Linux
Compression Commands in Linux
 
Linux security
Linux securityLinux security
Linux security
 
Linux Administration
Linux AdministrationLinux Administration
Linux Administration
 
[KubeConEU2023] Lima pavilion
[KubeConEU2023] Lima pavilion[KubeConEU2023] Lima pavilion
[KubeConEU2023] Lima pavilion
 
Advanced file permissions in linux
Advanced file permissions in linuxAdvanced file permissions in linux
Advanced file permissions in linux
 
How to hack Citrix (So, You Just Inherited Someone Else's Citrix Environment....
How to hack Citrix (So, You Just Inherited Someone Else's Citrix Environment....How to hack Citrix (So, You Just Inherited Someone Else's Citrix Environment....
How to hack Citrix (So, You Just Inherited Someone Else's Citrix Environment....
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debugging
 

Semelhante a Mongodb mock test_ii

Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBRaghunath A
 
11 schema design & crud
11 schema design & crud11 schema design & crud
11 schema design & crudAhmed Elbassel
 
Mongo Nosql CRUD Operations
Mongo Nosql CRUD OperationsMongo Nosql CRUD Operations
Mongo Nosql CRUD Operationsanujaggarwal49
 
Name _______________________________ Class time __________.docx
Name _______________________________    Class time __________.docxName _______________________________    Class time __________.docx
Name _______________________________ Class time __________.docxrosemarybdodson23141
 
Introduction To MongoDB
Introduction To MongoDBIntroduction To MongoDB
Introduction To MongoDBElieHannouch
 
Webinar: What's new in the .NET Driver
Webinar: What's new in the .NET DriverWebinar: What's new in the .NET Driver
Webinar: What's new in the .NET DriverMongoDB
 
Document Validation in MongoDB 3.2
Document Validation in MongoDB 3.2Document Validation in MongoDB 3.2
Document Validation in MongoDB 3.2MongoDB
 
MongoDB installation,CRUD operation & JavaScript shell
MongoDB installation,CRUD operation & JavaScript shellMongoDB installation,CRUD operation & JavaScript shell
MongoDB installation,CRUD operation & JavaScript shellShahDhruv21
 
Pega 7 csa questions,pega training in USA
Pega 7 csa questions,pega training in USAPega 7 csa questions,pega training in USA
Pega 7 csa questions,pega training in USAAshock Roy
 
I am having trouble writing the individual files for part 1, which i.pdf
I am having trouble writing the individual files for part 1, which i.pdfI am having trouble writing the individual files for part 1, which i.pdf
I am having trouble writing the individual files for part 1, which i.pdfmallik3000
 
PT1420 File Access and Visual Basic .docx
PT1420 File Access and Visual Basic                      .docxPT1420 File Access and Visual Basic                      .docx
PT1420 File Access and Visual Basic .docxamrit47
 
GSP 125 Entire Course NEW
GSP 125 Entire Course NEWGSP 125 Entire Course NEW
GSP 125 Entire Course NEWshyamuopten
 
Pega certification dumps
Pega certification dumpsPega certification dumps
Pega certification dumpsAshock Roy
 

Semelhante a Mongodb mock test_ii (20)

Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Vb.net
Vb.netVb.net
Vb.net
 
DP-420 Braindumps
DP-420 BraindumpsDP-420 Braindumps
DP-420 Braindumps
 
11 schema design & crud
11 schema design & crud11 schema design & crud
11 schema design & crud
 
Mongo Nosql CRUD Operations
Mongo Nosql CRUD OperationsMongo Nosql CRUD Operations
Mongo Nosql CRUD Operations
 
Name _______________________________ Class time __________.docx
Name _______________________________    Class time __________.docxName _______________________________    Class time __________.docx
Name _______________________________ Class time __________.docx
 
Introduction To MongoDB
Introduction To MongoDBIntroduction To MongoDB
Introduction To MongoDB
 
Webinar: What's new in the .NET Driver
Webinar: What's new in the .NET DriverWebinar: What's new in the .NET Driver
Webinar: What's new in the .NET Driver
 
Document Validation in MongoDB 3.2
Document Validation in MongoDB 3.2Document Validation in MongoDB 3.2
Document Validation in MongoDB 3.2
 
MongoDB installation,CRUD operation & JavaScript shell
MongoDB installation,CRUD operation & JavaScript shellMongoDB installation,CRUD operation & JavaScript shell
MongoDB installation,CRUD operation & JavaScript shell
 
Mongo DB 102
Mongo DB 102Mongo DB 102
Mongo DB 102
 
Pega 7 csa questions,pega training in USA
Pega 7 csa questions,pega training in USAPega 7 csa questions,pega training in USA
Pega 7 csa questions,pega training in USA
 
Mongo db basics
Mongo db basicsMongo db basics
Mongo db basics
 
PHP
PHPPHP
PHP
 
CPP Homework Help
CPP Homework HelpCPP Homework Help
CPP Homework Help
 
I am having trouble writing the individual files for part 1, which i.pdf
I am having trouble writing the individual files for part 1, which i.pdfI am having trouble writing the individual files for part 1, which i.pdf
I am having trouble writing the individual files for part 1, which i.pdf
 
PT1420 File Access and Visual Basic .docx
PT1420 File Access and Visual Basic                      .docxPT1420 File Access and Visual Basic                      .docx
PT1420 File Access and Visual Basic .docx
 
Mongo db
Mongo dbMongo db
Mongo db
 
GSP 125 Entire Course NEW
GSP 125 Entire Course NEWGSP 125 Entire Course NEW
GSP 125 Entire Course NEW
 
Pega certification dumps
Pega certification dumpsPega certification dumps
Pega certification dumps
 

Mais de Ankit Dubey

Unit 1 android and it's tools quiz {mad cwipedia}
Unit 1 android and it's tools quiz {mad cwipedia}Unit 1 android and it's tools quiz {mad cwipedia}
Unit 1 android and it's tools quiz {mad cwipedia}Ankit Dubey
 
Ch5 cpu-scheduling
Ch5 cpu-schedulingCh5 cpu-scheduling
Ch5 cpu-schedulingAnkit Dubey
 
Ch2 system structure
Ch2 system structureCh2 system structure
Ch2 system structureAnkit Dubey
 
Ch1 introduction-to-os
Ch1 introduction-to-osCh1 introduction-to-os
Ch1 introduction-to-osAnkit Dubey
 
Android mock test_iii
Android mock test_iiiAndroid mock test_iii
Android mock test_iiiAnkit Dubey
 
Android mock test_ii
Android mock test_iiAndroid mock test_ii
Android mock test_iiAnkit Dubey
 
Ajp notes-chapter-06
Ajp notes-chapter-06Ajp notes-chapter-06
Ajp notes-chapter-06Ankit Dubey
 
Ajp notes-chapter-05
Ajp notes-chapter-05Ajp notes-chapter-05
Ajp notes-chapter-05Ankit Dubey
 
Ajp notes-chapter-04
Ajp notes-chapter-04Ajp notes-chapter-04
Ajp notes-chapter-04Ankit Dubey
 
Ajp notes-chapter-03
Ajp notes-chapter-03Ajp notes-chapter-03
Ajp notes-chapter-03Ankit Dubey
 
Ajp notes-chapter-02
Ajp notes-chapter-02Ajp notes-chapter-02
Ajp notes-chapter-02Ankit Dubey
 

Mais de Ankit Dubey (20)

Unit 1 android and it's tools quiz {mad cwipedia}
Unit 1 android and it's tools quiz {mad cwipedia}Unit 1 android and it's tools quiz {mad cwipedia}
Unit 1 android and it's tools quiz {mad cwipedia}
 
Scheduling
Scheduling Scheduling
Scheduling
 
Chapter 4
Chapter 4Chapter 4
Chapter 4
 
Chapter 3
Chapter 3Chapter 3
Chapter 3
 
Chapter 2
Chapter 2Chapter 2
Chapter 2
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
 
Ch5 cpu-scheduling
Ch5 cpu-schedulingCh5 cpu-scheduling
Ch5 cpu-scheduling
 
Ch4 threads
Ch4 threadsCh4 threads
Ch4 threads
 
Ch3 processes
Ch3 processesCh3 processes
Ch3 processes
 
Ch2 system structure
Ch2 system structureCh2 system structure
Ch2 system structure
 
Ch1 introduction-to-os
Ch1 introduction-to-osCh1 introduction-to-os
Ch1 introduction-to-os
 
Android i
Android iAndroid i
Android i
 
Android mock test_iii
Android mock test_iiiAndroid mock test_iii
Android mock test_iii
 
Android mock test_ii
Android mock test_iiAndroid mock test_ii
Android mock test_ii
 
Ajp notes-chapter-06
Ajp notes-chapter-06Ajp notes-chapter-06
Ajp notes-chapter-06
 
Ajp notes-chapter-05
Ajp notes-chapter-05Ajp notes-chapter-05
Ajp notes-chapter-05
 
Ajp notes-chapter-04
Ajp notes-chapter-04Ajp notes-chapter-04
Ajp notes-chapter-04
 
Ajp notes-chapter-03
Ajp notes-chapter-03Ajp notes-chapter-03
Ajp notes-chapter-03
 
Ajp notes-chapter-02
Ajp notes-chapter-02Ajp notes-chapter-02
Ajp notes-chapter-02
 

Último

CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction managementMariconPadriquez1
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitterShivangiSharma879191
 
An introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxAn introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxPurva Nikam
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...121011101441
 

Último (20)

CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction management
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter
 
An introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxAn introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptx
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 

Mongodb mock test_ii

  • 1. http://www.tutorialspoint.com Copyright © tutorialspoint.com MONGODB MOCK TEST MONGODB MOCK TEST This section presents you various set of Mock Tests related to MongoDB Framework. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself. MONGODB MOCK TEST II MONGODB MOCK TEST II Q 1 - What does the following MongoDB command return? db.posts.findlikes: $gt: 100, likes: $lt: 200; A - Posts with likes greater than 100 but less than 200 B - Posts with likes greater than or equal to 100 but less than or equal to 200 C - Posts with likes less than 200 D - Will return syntax error Q 2 - Consider that our posts collection contains an array field called tags that contains tags that the user enters. { _id: 1, tags: ["tutorial", "fun", "learning"], post_text: "This is my first post", //other elements of document } Which of the following commands will find all the posts that have been tagged as tutorial? Q 3 - Which of the following is the most important consideration while designing the schema for MongoDB? A - The schema should match the data access and query patterns B - The schema should be kept in 3NF similar to SQL schemas C - The schema should focus on creating possible embedded documents D - The schema should contain maximum indexes
  • 2. Q 4 - Which of the following operations on a single document will operate atomically? A - update B - $push C - Both a and b D - None of the above Q 5 - Which of the following is supported by MongoDB? A - ACID Transactions B - Relationships between Collections PrimaryKey − ForeignKey C - Journaling D - Transaction Management Q 6 - Consider that our posts collection contains an array field called tags that contains tags that the user enters. { _id: 1, tags: ["tutorial", "fun", "learning"], post_text: "This is my first post", //other elements of document } What does the following command return: db.posts.find′tags.0′ :" tutorial " A - All the posts whose tags array contains tutorial B - All the posts which contains only one tag element in the tag array C - All the posts having the first element of the tags array as tutorial D - All the posts which contains 0 or more tags named tutorial Q 7 - Consider that the posts collection contains an array called ratings which contains ratings given to the post by various users in the following format: { _id: 1, post_text: "This is my first post", ratings: [5, 4, 2, 5], //other elements of document } Which of the following query will return all the documents where the array ratings contains at least one element between 3 and 6? A - db.inventory.findratings: $elemMatch: $gt: 3, $lt: 6 B - db.inventory.findratings: ratings: $gt: 5, $lt: 9 C - db.inventory.findratings: ratings. $: $gt: 5, $lt: 9
  • 3. D - db.inventory.findratings: $elemMatch: $gte: 3, $lte: 6 Q 8 - Consider that the posts collection contains an array called ratings which contains ratings given to the post by various users in the following format: { _id: 1, post_text: "This is my first post", ratings: [5, 4, 2, 5], //other elements of document } Which of the following query will return all the documents where the ratings array contains elements that in some combination satisfy the query conditions? A - db.inventory.findratings: $elemMatch: $gt: 3, $lt: 6 B - db.inventory.findratings: ratings: $gt: 5, $lt: 9 C - db.inventory.findratings: ratings. $: $gt: 5, $lt: 9 D - db.inventory.findratings: $elemMatch: $gte: 3, $lte: 6 Q 9 - Which option should be used to update all the documents with the specified condition in the MongoDB query? A - updateAll instead of update B - specify {multi : true} as the third parameter of update command C - specify {all: true} as the third parameter of update command D - specify {updateAll: true} as the third parameter of update command Q 10 - What does the following query do when performed on the posts collection? db.posts.updateid: 1, Title: ThisispostwithID1 " A - Updates the Title of the post B - Updating a document is possible only with $set C - Replaces the complete document with _id as 1 with the document specified in second parameter D - Syntax error Q 11 - What does the following query do when performed on the posts collection? db.posts.updateid: 1, $set: Author:" Tom " A - Sets the complete document with _id as 1 with the document specified in second parameter by replacing it completely B - Adds a new field Author in the searched collection if not already present C - Updates only the Author field of the document with _id as 1 D - Both b and c
  • 4. Q 12 - Which option can be used with update command so that a new document gets created if no matching document is found based on the query condition? A - Specify {upsert : true } as the third parameter of update command B - upsert command instead of update command C - {update: true, insert: true} as the third parameter of update command D - This has to be handled in application code Node.js, PHP, JAVA, C#, etc. and cannot be handled in mongo shell query Q 13 - Consider that you are using { upsert : true } option in your update command. Which of the following parameters will be used to determine if any new documents were inserted: A - nMatched B - nInserted C - nModified D - nUpserted Q 14 - Which of the following commands removes a single document that matches the condition that Author is Joe? D - Both b and c Q 15 - What is the output of following two commands in MongoDB: db.posts.insert "id ": 1 db.posts.insert "id ": 1 A - Two documents will be inserted with _id as 1 B - MongoDB will automatically increment the _id of the second document as 2 C - This will throw a duplicate key error D - It will insert two documents and throw a warning to the user Q 16 - Which option should be used with findAndModify command to return the modified document instead of the pre-modification document? A - findAndModify by default returns the pre-modification document B - Set {new : true} C - Use the POST version of findAndModify called findAndModifyPost D - Both b and c are valid Q 17 - Consider the following posts document:
  • 5. { _id: 1, post_text: "This is my first post", author: "Tom", tags: ["tutorial","quiz","facebook","learning","fun"] } Which of the following queries will return the documents but with only the first two tags in the tags array? D - Both a and c are valid. $slice works both with projection and limit. Q 18 - Which are the ONLY ways to project portions of an array? A - $elemMatch B - $slice C - $ D - All of the above Q 19 - Which of the following operator can be used to limit the number of documents in an array field of a document after an update is performed? A - pushalongwitheach, sortandslice B - $removeFromSet C - $arrayLimit D - None of the above Q 20 - Which of the following methods can be used on a cursor object? A - cursor.next B - cursor.hasNext C - cursor.forEach D - All of the above Q 21 - Which language is MongoDB written in? A - C++ B - Java C - Python D - MongoC Q 22 - Which type of indexes does MongoDB support? A - Compound Indexes B - Multikey Indexes
  • 6. C - Geospatial Indexes D - All of the above Q 23 - What does the totalKeysExamined field returned by the explain method indicate? A - Number of documents that match the query condition B - Number of index entries scanned C - Number of documents scanned D - Details the completed execution of the winning plan as a tree of stages Q 24 - If the value of totalKeysExamined is 30000 and the value of totalDocsExamined is 0, which of the following option is correct? A - The query used an index to fetch the results B - The query returned 30000 documents after scanning the documents C - The query returned 0 documents D - None of the above Q 25 - You can implement a multi-document transaction in MongoDB using which of the following concept? A - Tailable Cursor B - Two Phase Commits C - Compound Indexing D - Multi Document Transaction is not supported by MongoDB ANSWER SHEET ANSWER SHEET Question Number Answer Key 1 C 2 A 3 A 4 C 5 C 6 C 7 A 8 B 9 B
  • 7. 10 C 11 D 12 A 13 D 14 D 15 C 16 B 17 A 18 D 19 A 20 D 21 A 22 D 23 B 24 A 25 B Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js