Uploaded by shantoshpass

Updated MongoDB C100DEV Dumps V8.02.pdf

advertisement
DUMPS
BASE
EXAM DUMPS
MONGODB
C100DEV
28% OFF Automatically For You
MongoDB Certified Developer Associate
1.Why is MongoDB a NoSQL database?
A. Because MongoDB uses a structured way to store and organize data (collections).
B. Because MongoDB uses tables, rows and columns to organize data.
C. Because MongoDB does not utilize tables, rows and columns to organize data.
Answer : A,C
Explanation:
https://www.mongodb.com/nosql-explained
U
pd
at
ed
M
on
go
D
B
C
10
0D
E
V
D
um
ps
V
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
as
si
ng
S
uc
ce
ss
fu
lly
2.Suppose you have a movies collection with the following document structure:
{
_id: ObjectId("573a1390f29313caabcd60e4"),
title: 'The Immigrant',
fullplot: "Charlie is on his way to the USA. He wins in a card game, puts the money in
Edna's bag (she and her sick mother have been robbed of everything). When he
retrieves a little for himself he is accused of being a thief. Edna clears his name.
Later, broke, Charlie finds a coin and goes into a restaurant." }
You want to perform text search queries on fullplot field.
What do you have to do?
Just query the database. For example:
A. Just query the database. For example:
db.movies.find( { $text: { $search: 'spaceship'} } ).explain()
B. First, create a text index: db.movies.createIndex( { fullplot: 'text' } ) Then query the
database:
db.movies.find( { $text: { $search: 'spaceship' } } )
C. First, create an index:
D. db.movies.createIndex( { fullplot: 1 } ) Then query the database:
db.movies.find( { $text: { $search: 'spaceship' } } )
Answer : B
Explanation:
https://docs.mongodb.com/manual/text-search/
https://docs.mongodb.com/manual/core/index-text/
3.In your database there is a collection named trips with the following document
structure:
{
'_id': ObjectId("572bb8222b288919b68abf6d"),
'trip_duration': 858,
'start_station id': 532,
'end_station_id': 401,
'bike_id': 17057,
'start_station_location': { type: 'Point', coordinates: [ -73.960876, 40.710451 ] },
ss
fu
lly
'end_station_location': { type: 'Point', coordinates: [ -73.98997825, 40.72019576 ] },
'start_time': ISODate("2016-01-01T00:09:31.000Z"), 'stop_time':
ISODate("2016-01-01T00:23:49.000Z") }
How can you extract all trips from this collection ended at stations that are to the west
of the -73.5 longitude coordinate?
A. db.trips.find( { 'coordinates': { $lt: -73.5 } } )
B. db.trips.find( { 'end_station_location.coordinates.0': { $gt: -73.5 } } )
C. db.trips.find( { 'end_station_location.coordinates.0': { $lt: -73.5 } } )
D. db.trips.find( { 'end_station_location.coordinates.1': { $lt: -73.5 } } )
Answer : C
Explanation:
https://docs.mongodb.com/manual/reference/operator/query/lt/
U
pd
at
ed
M
on
go
D
B
C
10
0D
E
V
D
um
ps
V
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
as
si
ng
S
uc
ce
4.You have a developers collection with the following document structure:
{
_id: 1,
fname: 'John',
lname: 'Smith',
tech_stack: ['sql', 'git', 'python', 'linux', 'django', 'aws']
},
{
_id: 2,
fname: 'Michael',
lname: 'Doe',
tech_stack: [ 'git', 'python', 'sqlite', 'linux', 'flask' ]
}
Which of the following queries will return only the first three elements of the array in
the tech_stack field?
A. db.developers.find( {}, { tech_stack: [0, 1, 2] } )
B. db.developers.find( { tech_stack: { $slice: [0, 3] } } )
C. db.developers.find( {}, { tech_stack: [0, 3] } )
D. db.developers.find( {}, { tech_stack: { $slice: [0, 3] } } )
Answer : D
Explanation:
https://docs.mongodb.com/manual/reference/operator/update/slice/
5.What is the built-in database called local in MongoDB for?
A. The local database plays an important role in the authentication and authorization
process. Certain actions performed by administrators also require access to this
database.
B. The local database is used to store information about shards in shared MongoDB
cluster.
C. The local database stores data describing the MongoDB server. For replica sets, it
also stores
information about the replication process.
Answer : C
Explanation:
https://docs.mongodb.com/manual/reference/local-database/
M
on
go
D
B
C
10
0D
E
V
D
um
ps
V
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
as
si
ng
S
uc
ce
ss
fu
lly
6.Given a movies collection where each document has the following structure:
{
_id: ObjectId("573a1390f29313caabcd60e4"),
genres: [ 'Short', 'Comedy', 'Drama' ],
title: 'The Immigrant',
year: 1917,
imdb: { rating: 7.8, votes: 4680, id: 8133 },
countries: [ 'USA' ]
}
Which of the following queries will find all Comedy movies that were made in 2000?
(select 2)
A. db.movies.find( { year: 2000 }, { genres: "Comedy" } )
B. db.movies.find( { $or: [ { year: 2000 }, { genres: "Comedy" } ] } )
C. db.movies.find( { year: 2000, genres: "Comedy" } )
D. db.movies.find( { $and: [ { year: 2000 }, { genres: "Comedy" } ] } )
Answer : C,D
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.find/
https://docs.mongodb.com/manual/reference/operator/query/and/
U
pd
at
ed
7.Which cursor method should you use to specify the maximum number of documents
returned?
A. cursor.map()
B. cursor.limit()
C. cursor.skip()
D. cursor.hint()
E. cursor.count()
Answer : B
Explanation:
https://docs.mongodb.com/manual/reference/method/cursor.limit/
8.What does it command do in the mongo shell?
A. Iterates through the cursor results.
B. Terminates the current query execution.
C. it is not a mongo shell command.
D. Displays cluster statistics.
Answer : A
U
pd
at
ed
M
on
go
D
B
C
10
0D
E
V
D
um
ps
V
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
as
si
ng
S
uc
ce
ss
fu
lly
9.Which of the following commands will successfully insert exactly two new
documents into an empty companies collection?
A. db.companies.insertMany([
{"_id": 1, "name": "Facebook"},
{"_id": 1, "name": "Twitter"},
{"_id": 2, "name": "Tesla"}
], {"ordered": false})
B. db.companies.insertMany([
{"_id": 1, "name": "Facebook"},
{"_id": 1, "name": "Twitter"},
{"_id": 2, "name": "Tesla"}
])
C. db.companies.insertMany([
{"_id": 1, "name": "Facebook"},
{"_id": 2, "name": "Twitter"}
])
D, db.companies.insertMany([
{"_id": 1, "name": "Facebook"},
{"_id": 2, "name": "Twitter"},
{"_id": 2, "name": "Tesla"}
])
E. db.companies.insertMany([
F. {"name": "Facebook"},
G. {"name": "Twitter"}
H. ])
Answer : A,C,D,E
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.insertMany/
10.Which of the following commands will delete a collection named restaurants?
A. db.restaurants.dropCollection()
B. db.restaurants.delete()
C. db.restaurants.remove()
D. db.restaurants.drop()
Answer : D
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.drop/
uc
ce
ss
fu
lly
11.What are some of the uses for the $ sign in MQL (MongoDB Query Language)?
(select 2)
A. The $ sign has no special meaning in MQL.
B. When $ is used to prefix a field
name,wwwit.dumpspandarepresentsthev.luecomstored in that field.
C. $ denotes an operator - all MQL operators have the $ prefix.
Answer : B,C
Explanation:
https://docs.mongodb.com/manual/core/dot-dollar-considerations/
U
pd
at
ed
M
on
go
D
B
C
10
0D
E
V
D
um
ps
V
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
as
si
ng
S
12.Given a movies collection where each document has the following structure:
{
_id: ObjectId("573a1390f29313caabcd60e4"),
genres: [ 'Short', 'Comedy', 'Drama' ],
title: 'The Immigrant',
year: 1917,
imdb: { rating: 7.8, votes: 4680, id: 8133 },
countries: [ 'USA' ]
}
Which of the following queries will find all movies that do not contain the Comedy and
Romance genres?
A. db.movies.find( { genres: { $or: ["Comedy", "Romance"] } } )
B. db.movies.find( { genres: { $in: ["Comedy", "Romance"] } } )
C. db.movies.find( { genres: { $nin: ["Comedy", "Romance"] } } )
Answer : C
Explanation:
https://docs.mongodb.com/manual/reference/operator/query/nin/
13.In your database a movies collection is given where each document has the
following structure:
{
_id: ObjectId("573a1391f29313caabcd9264"),
genres: [ 'Romance', 'Drama' ],
title: 'The Divorcee',
languages: [ 'English', 'French' ],
year: 1930,
imdb: { rating: 6.9, votes: 1740, id: 20827 },
lly
countries: [ 'USA' ]
}
Which of the following queries will return all movies that are in the Fantasy and Drama
(both) genre?
A. db.movies.find( { genres: { $elemMatch: ['Fantasy', 'Drama'] } } )
B. db.movies.find( { genres: { $in: ['Fantasy', 'Drama'] } } )
C. db.movies.find( { genres: { $size: ['Fantasy', 'Drama'] } } )
D. db.movies.find( { genres: { $all: ['Fantasy', 'Drama'] } } )
Answer : D
Explanation:
https://docs.mongodb.com/manual/reference/operator/query/all/
V
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
as
si
ng
S
uc
ce
ss
fu
14.Which cursor method should you use to force MongoDB to use a specific index for
a query?
A. cursor.index()
B. cursor.hint()
C. cursor.explain()
D. cursor.use()
Answer : B
Explanation:
https://docs.mongodb.com/manual/reference/method/cursor.hint/
U
pd
at
ed
M
on
go
D
B
C
10
0D
E
V
D
um
ps
15.Given the following MongoDB URI:
mongodb+srv://datascientist34:ta33w9rd@xtr-187.srv.net/admin Which of the
following statements are true? (select 2)
A. There are 178 nodes in the xtr replica set.
B. The password used for authentication is xtr-178
C. The password used for authentication is ta33w9rd
D. The user datascientist34 is trying to authenticate on database admin.
Answer : C,D
Explanation:
https://docs.mongodb.com/manual/reference/connection-string/
16.Suppose you have a sales collection with the following document structure:
{
_id: ObjectId("5bd761dcae323e45a93ccfe8"),
saleDate: ISODate("2015-03-23T21:06:49.506Z"),
items: [
{
name: 'printer paper',
M
on
go
D
B
C
10
0D
E
V
D
um
ps
V
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
as
si
ng
S
uc
ce
ss
fu
lly
tags: [ 'office', 'stationary' ],
price: Decimal128("40.01"),
quantity: 2
}
{
name: 'pens',
tags: [ 'writing', 'office', 'school', 'stationary' ],
price: Decimal128("56.12"),
quantity: 5
},
{
name: 'notepad',
tags: [ 'office', 'writing', 'school' ],
price: Decimal128("18.47"),
quantity: 2
}
],
storeLocation: 'Denver',
couponUsed: true,
purchaseMethod: 'Online'
}
Which of the following queries will return all document sales with 'printer paper' sold?
A. db.sales.find( { items: { $match: { name: 'printer paper' } } } )
B. db.sales.find( { items: { $elemMatch: { name: 'printer paper' } } } )
C. db.sales.find( { items: { elemMatch: { name: 'printer paper' } } } )
Answer : B
Explanation:
https://docs.mongodb.com/manual/reference/operator/query/elemMatch/
U
pd
at
ed
17.Select true statement regarding to the MongoDB Atlas. (select 1)
A. MongoDB Atlas is a MongoDB service that can work with any database.
B. MongoDB Atlas includes many tools and services specifically designed for the
MongoDB database.
Answer : B
Explanation:
https://docs.atlas.mongodb.com/
18.You have a companies collection with the following document structure:
{
_id: ObjectId('52cdef7c4bab8bd675297dac'),
name: 'Veoh',
rc
e
Fo
r
P
as
si
ng
S
uc
ce
ss
fu
lly
homepage_url: 'http://www.veoh.com',
category_code: 'games_video',
number_of_employees: null,
founded_year: 2004,
tag_list: 'veoh, video, veohtv, socialvideo, videosharing, crunchbase, inuyasha',
email_address: 'pr@veoh.com',
description: 'Internet TV service'
}
How can you use projection to extract all documents with the following fields: name,
homepage_url, tag_list?
A. db.companies.find( {}, { _id: 1, name: 1, homepage_url: 1, tag_list: 1 } )
B. db.companies.find( {}, { _id: 0, name: 1, homepage_url: 1, tag_list: 1 } )
C. db.companies.find( {}, { name: 1, homepage_url: 1, tag_list: 1 } )
D. db.companies.find( { _id: 0, name: 1, homepage_url: 1, tag_list: 1 } )
Answer : C
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.find/
go
D
B
C
10
0D
E
V
D
um
ps
V
8.
02
-L
at
es
t
R
es
ou
19.How does the document relate to the collection in MongoDB? Check all that apply.
A. Documents are organized into collections.
B. Collections are tables of documents.
C. Documents consist of collections.
D. Collections consists of one or many documents.
Answer : A,D
Explanation:
https://docs.mongodb.com/manual/core/databases-and-collections/
U
pd
at
ed
M
on
20.Given a movies collection where each document has the following structure:
{
_id: ObjectId('573a1390f29313caabcd60e4'),
genres: [ 'Short', 'Comedy', 'Drama' ],
title: 'The Immigrant',
year: 1917,
imdb: { rating: 7.8, votes: 4680, id: 8133 },
countries: [ 'USA' ]
}
Which of the following queries will find all the movies that have more votes than the
year in which they were released?
A. db.movies.find({ $expr: { $gt: ["imdb.votes", "year"] } } )
B. db.movies.find({ $expr: { $lt: ["$imdb.votes", "$year"] } } )
C. db.movies.find({ $expr: { $gt: ["$imdb.votes", "$year"] } } )
Answer : C
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.find/
ng
S
uc
ce
ss
fu
lly
21.Select all true statement regarding to the MongoDB (BSON, JSON). (select 3)
A. MongoDB stores data in BSON, and we can view it in JSON.
B. MongoDB stores data in JSON, and we can view it in BSON.
C. BSON supports as many data types as JSON.
D. BSON supports more data types than JSON.
E. BSON is faster to parse and lighter to store than JSON.
Answer : A,D,E
Explanation:
https://www.mongodb.com/json-and-bson
0D
E
V
D
um
ps
V
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
as
si
22.Select all true statements regarding to the insert operation.
A. If you insert a document with no _id value specified, it will result in a write error.
B. If you insert document with a _id field value that already exists, an error will be
raised.
C. MongoDB will automatically add an _id field when inserting document without
specified _id field into a collection.
Answer : B,C
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.insert/
U
pd
at
ed
M
on
go
D
B
C
10
23.Suppose you want to familiarize with a new collection and want to display a single
document.
Which collection method should you use in this case?
A. db.collection.getOne()
B. db.collection.findOne()
C. db.collection.find()
D. db.collection.explain()
Answer : B
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.findOne/
24.Why is MongoDB using BSON instead of JSON to store data? Select all that
apply.
A. BSON format is not human readable (BSON is machine-readable only).
B. BSON supports more data types than JSON.
C. BSON contains metadata to describe a document/object.
D. BSON simply means 'Binary JSON'.
Answer : A,B,C,D
Explanation:
https://www.mongodb.com/json-and-bson
U
pd
at
ed
M
on
go
D
B
C
10
0D
E
V
D
um
ps
V
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
as
si
ng
S
uc
ce
ss
fu
lly
25.Suppose you have an accounts collection with the following document structure:
{
_id: ObjectId("61af47c6e29861661d063714"),
account_id: 1010,
type: 'investment',
limit: 1000000
},
{
_id: ObjectId("61af47c6e29861661d063715"),
account_id: 4336,
type: 'derivatives',
limit: 100000
},
{
_id: ObjectId("61af47c6e29861661d063716"),
account_id: 4336,
type: 'commodity',
limit: 1000
}
Which of the following documents would be modified by this update?
db.accounts.updateMany( { "type": "investment" }, { "$set": { "limit": 2000000 } } )
A. {
_id: ObjectId("61af47c6e29861661d063715"),
account_id: 4336,
type: 'derivatives',
limit: 100000
}
B. {
_id: ObjectId("61b1bde1ceb6f770f56b0cd9"),
account_id: 4915,
type: 'investment',
limit: 1000000
}
C.
{
_id: ObjectId("61af47c6e29861661d067825"),
uc
ce
ss
fu
lly
account_id: 7355,
type: 'commodity',
limit: 500000
}
D. {
_id: ObjectId("61af47c6e29861661d063714"),
account_id: 1010,
type: 'investment',
limit: 1000000
}
Answer : B,D
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.updateMany/
C
10
0D
E
V
D
um
ps
V
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
as
si
ng
S
26.Select all true statements about text search in MongoDB.
A. MongoDB provides text indexes to support text search queries on string content.
B. To perform text search queries, you must have a text index on your collection.
C. A collection can only have one text search index, but that index can cover multiple
fields.
D. Text indexes cannot include any field whose value is an array of string elements.
E. Text indexes can include any field whose value is a string.
F. To perform text searches on a collection we use $text operator.
Answer : A,B,C,E,F
Explanation:
https://docs.mongodb.com/manual/text-search/
U
pd
at
ed
M
on
go
D
B
27.Given a movies collection where each document has the following structure:
{
_id: ObjectId('573a1390f29313caabcd60e4'),
genres: [ 'Short', 'Comedy', 'Drama' ],
title: 'The Immigrant',
year: 1917,
imdb: { rating: 7.8, votes: 4680, id: 8133 },
countries: [ 'USA' ]
}
Which of the following queries will find all movies that were made in 2000 or 2010?
A. db.movies.find( { $or: [ { year: 2000 }, { year: 2010 } ] } )
B. db.movies.find( { year: 2000, year: 2010 } )
C. db.movies.find( { $and: [ { year: 2000 }, { year: 2010 } ] } )
D. db.movies.find( { $in: [ { year: 2000 }, { year: 2010 } ] } )
Answer : A
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.find/
https://docs.mongodb.com/manual/reference/operator/query/or/
U
pd
at
ed
M
on
go
D
B
C
10
0D
E
V
D
um
ps
V
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
as
si
ng
S
uc
ce
ss
fu
lly
28.In your database there is a movies collection with the following document
structure:
{
_id: ObjectId("573a1390f29313caabcd42e8"),
genres: [ 'Short', 'Western' ],
title: 'The Great Train Robbery',
rated: 'TV-G',
year: 1903,
imdb: { rating: 7.4, votes: 9847, id: 439 },
countries: [ 'USA' ]
},
{
_id: ObjectId("573a1390f29313caabcd4323"),
genres: [ 'Short', 'Drama', 'Fantasy' ],
rated: 'UNRATED',
title: 'The Land Beyond the Sunset',
year: 1912,
imdb: { rating: 7.1, votes: 448, id: 488 },
countries: [ 'USA' ]
}
Which of the following queries will return only the title for the five oldest movies in this
collection?
A. db.movies.find( {}, { title: 1, _id: 0 } ).sort( { year: 1 } ).skip(5).limit(5)
B. db.movies.find( {}, { title: 1, _id: 0 } ).sort( { year: 1 } ).limit(5)
C. db.movies.find( {}, { title: 1 } ).sort( { year: 1 } ).limit(5)
D. db.movies.find( {}, { title: 1, _id: 0 } ).sort( { year: 1 } ).skip(5)
Answer : B
Explanation:
https://docs.mongodb.com/manual/reference/method/cursor.sort/
29.Can arrays in MongoDB store values of different data types?
A. No
B. Yes
Answer : B
30.Which of the following commands will add a collection that is stored in BSON file to
a MongoDB cluster?
A. mongodump
B. mongorestore
C. mongoimport
D. mongoexport
Answer : B
Explanation:
https://docs.mongodb.com/database-tools/mongorestore/
0D
E
V
D
um
ps
V
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
as
si
ng
S
uc
ce
ss
fu
lly
31.Suppose you have a developers collection with the following document structure:
{
_id: 1,
fname: 'Bob',
lname: 'Smith',
tech_stack: [ 'git', 'c++', 'sqlite', 'linux' ]
}
Select a query that can be executed without errors.
A. db.developers.updateOne( { _id: 1 }, { $set: { _id: 3 } } )
B. db.developers.updateOne( { _id: 1 }, { $set: { fname: 'John' } } )
C. db.developers.updateOne( { _id: 1 }, { $unset: { _id: '' } } )
D. db.developers.updateOne( { _id: 1 }, { $set: { _id: 3, fname: 'Bob' } } )
Answer : B
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.updateOne/
U
pd
at
ed
M
on
go
D
B
C
10
32.Suppose you have a sales collection with the following document structure:
{
_id: ObjectId("5bd761dcae323e45a93ccfe8"),
saleDate: ISODate("2015-03-23T21:06:49.506Z"),
items: [
{
name: 'printer paper',
tags: [ 'office', 'stationary' ],
price: Decimal128("40.01"),
quantity: 2
}
{
name: 'pens',
tags: [ 'writing', 'office', 'school', 'stationary' ],
price: Decimal128("56.12"),
quantity: 5
V
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
as
si
ng
S
uc
ce
ss
fu
lly
},
{
name: 'notepad',
tags: [ 'office', 'writing', 'school' ],
price: Decimal128("18.47"),
quantity: 2
}
],
storeLocation: 'Denver',
couponUsed: true,
purchaseMethod: 'Online'
}
Which operator should you use to extract all sales documents that have 'notepad'
name in items field?
A. $in
B. $elemMatch
C. $nin
D. $match
E. $all
Answer : B
Explanation:
https://docs.mongodb.com/manual/reference/operator/query/elemMatch/
U
pd
at
ed
M
on
go
D
B
C
10
0D
E
V
D
um
ps
33.Select all true statements about differences between using aggregate() and find()
methods?
A. find() allows us to compute and reshape data in the cursor.
B. Any aggregation pipeline can be translated into a find() query.
C. Any find() query can be translated into an aggregation pipeline.
D. aggregate() allows us to compute and reshape data in the cursor (like $group,
$min and other
stages).
Answer : C,D
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.find/
https://docs.mongodb.com/manual/reference/method/db.collection.aggregate/
34.Select all true statements about the update operation. (select 2)
A. updateOne() method with the $set operator updates the first document that
matches the query.
B. If the field doesn't exist, updateOne() method with the $set operator will not add a
new field with the specified value.
C. updateOne() method with the $set operator updates an existing document field
with the given value.
Answer : A,C
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.updateOne/
uc
ce
ss
fu
lly
35.Select all true statements regarding to duplicate documents in MongoDB.
A. MongoDB can store duplicate documents in the same collection, as long as their
_id values are different.
B. MongoDB can store duplicate documents in the same collection (with the same _id
value).
Answer : A
um
ps
V
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
as
si
ng
S
36.Which collection method do you need to use to drop a specific collection?
A. db.collection.drop()
B. db.collection.dropIndex()
C. db.collection.dropCollection()
D. db.collection.remove()
Answer : A
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.drop/
U
pd
at
ed
M
on
go
D
B
C
10
0D
E
V
D
37.Suppose you insert the following documents into companies collection:
db.companies.insertMany([
{"_id": 1, "name": "Facebook"},
{"_id": 1, "name": "Twitter"},
{"_id": 2, "name": "Tesla"},
{"_id": 3, "name": "Amazon"}
], {"ordered": false})
Select all true statements about this operation. (select 3)
A. Two documents will be inserted into the collection.
B. This insert is unordered.
C. Three documents will be inserted into the collection.
D. MongoDB will insert each document with a unique _id value into the collection.
E. One document will be inserted into the collection.
Answer : B,C,D
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.insertMany/
38.Which of the following statements are true about the mongo shell? Check all that
apply.
A. Mongo shell is a fully functioning JavaScript interpreter (which means that we can
create things like JavaScript variables and functions in mongo shell).
B. Mongo shell allows us to interact with MongoDB instance without using GUI.
C. The mongo shell doesn't return documents in sorted order by default.
D. You can get a sorted set of documents by using the sort() method.
Answer : A,B,C,D
Explanation:
https://docs.mongodb.com/manual/reference/mongo-shell/
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
as
si
ng
S
uc
ce
ss
fu
lly
39.Suppose you have a books collection with title field.
Which of the following queries will return all books with a title ending in 'ian'?
A. db.movies.find( { title: { $regex: /.*ian$/ } } )
B. db.movies.find( { title: { $text: /.*ian$/ } } )
C. db.movies.find( { title: { $regex: /.*ian/ } } )
D. db.movies.find( { title: { $regex: /ian/ } } )
Answer : A
Explanation:
https://docs.mongodb.com/manual/reference/operator/query/regex/
U
pd
at
ed
M
on
go
D
B
C
10
0D
E
V
D
um
ps
V
40.Given a companies collection where each document has the following structure:
{
_id: ObjectId('61a8b90c6d5ce6a7d8fef95e'),
name: 'Facebook',
tag_list: ['facebook', 'college', 'students', 'network'],
description: 'Social network'
}
Which of the following commands will add new fields to the updated documents?
A. db.companies.updateMany({ "name": "Facebook" },
B. { "$push": { "tag_list": "media" } })
C. db.companies.updateMany({ "name": "Facebook" },
D. { "$set": { "description": "Social media" } })
E. db.companies.updateMany({ "name": "Facebook" },
F. { "$set": { "country": "USA" } })
Answer : F
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.updateMany/
41.There are some special databases in MongoDB that we cannot use to create a
lly
new database. Select those names.
A. admin
B. local
C. apps
D. config
E. users
Answer : A,B,D
Explanation:
https://docs.mongodb.com/manual/reference/local-database/
https://docs.mongodb.com/manual/tutorial/manage-users-and-roles/
https://docs.mongodb.com/manual/reference/config-database/
t
R
es
ou
rc
e
Fo
r
P
as
si
ng
S
uc
ce
ss
fu
42.Is MongoDB a NoSQL database?
A. Yes
B. No
Answer : A
Explanation:
https://www.mongodb.com/nosql-explained
U
pd
at
ed
M
on
go
D
B
C
10
0D
E
V
D
um
ps
V
8.
02
-L
at
es
43.Given a companies collection where each document has the following structure:
{
_id: ObjectId("52cdef7c4bab8bd675297efd"),
name: 'ZoomInfo',
homepage_url: 'http://www.zoominfo.com',
blog_url: 'http://zoominfoblogger.wordpress.com/',
twitter_username: 'ZoomInfo',
founded_year: 2000,
email_address: ''
}
Extract all companies from this collection that have the same Twitter username as the
company name.
Which query should you use?
A. db.companies.find( { $expr: { $ne: ['$name', '$twitter_username'] } } )
B. db.companies.find( { $expr: { $eq: ['$name', '$twitter_username'] } } )
C. db.companies.find( { $expr: { $eq: ['$name', 'twitter_username'] } } )
D. db.companies.find( { $expr: { $eq: ['name', 'twitter_username'] } } )
Answer : B
Explanation:
db.companies.find( { $expr: { $eq: ['$name', 'twitter_username'] } } ) You have to use $
sign to evaluate twitter_username field. db.companies.find( { $expr: { $eq: ['name',
'twitter_username'] } } ) You have to use $ sign to evaluate name and
twitter_username fields.
https://docs.mongodb.com/manual/reference/operator/query/expr/
as
si
ng
S
uc
ce
ss
fu
lly
44.There is a collection named products in MongoDB database. Your coworker wants
to know how many products are in this collection (number of documents in the
collection) from the United States.
Which query should you use?
A. db.products.find( { country: "USA" } ).count()
B. db.products.find( country = "USA" ).count()
C. db.products.find( country == "USA" ).count()
D. db.products.find( { country: "USA" } )
Answer : A
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.find/
V
D
um
ps
V
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
45.Does MongoDB support query operations that perform a text search of string
content?
A. Yes
B. No
Answer : A
Explanation:
https://docs.mongodb.com/manual/text-search/
U
pd
at
ed
M
on
go
D
B
C
10
0D
E
46.What is the built-in database called config in MongoDB for?
A. The config database is used to store information about shards in shared MongoDB
cluster.
B. The config database plays an important role in the authentication and authorization
process. Certain actions performed by administrators also require access to this
database.
C. The config database stores data describing the MongoDB server. For replica sets,
it also stores
information about the replication process.
Answer : A
Explanation:
https://docs.mongodb.com/manual/reference/config-database/
47.Given a movies collection where each document has the following structure:
{
_id: ObjectId("573a1391f29313caabcd9264"),
as
si
ng
S
uc
ce
ss
fu
lly
genres: [ 'Romance', 'Drama' ],
title: 'The Divorcee',
languages: [ 'English', 'French' ],
year: 1930,
imdb: { rating: 6.9, votes: 1740, id: 20827 },
countries: [ 'USA' ]
}
Which of the following queries will find all movies that have exactly 5 languages?
A. db.movies.find( { languages: { $eq: 5 } } )
B. db.movies.find( { languages: { $gt: 5 } } )
C. db.movies.find( { languages: 5 } )
D. db.movies.find( { languages: { $size: 5 } } )
Answer : D
Explanation:
https://docs.mongodb.com/manual/reference/operator/query/size/
U
pd
at
ed
M
on
go
D
B
C
10
0D
E
V
D
um
ps
V
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
48.There is a gamers collection in your database with the following document
structure:
{ _id: 1, level: 15, is_active: true },
{ _id: 2, level: 14, is_active: true },
{ _id: 3, level: 7, is_active: false }
How do you update the value of the level field to 20 for a player with an id = 2?
A. Expected result:
B. { _id: 1, level: 15, is_active: true },
C. { _id: 2, level: 20, is_active: true },
D. { _id: 3, level: 7, is_active: false }
E. db.gamers.update( { _id: 2 }, { level: 20 } )
F. db.gamers.update( { _id: 2 }, { $inc: { level: 20 } } )
G. db.gamers.update( { _id: 2 }, { $set: { level: 20 } } )
Answer : G
Explanation:
https://docs.mongodb.com/manual/reference/operator/update/set/
49.Suppose you have a movies collection with the following document structure:
{
_id: ObjectId("573a1390f29313caabcd60e4"),
title: 'The Immigrant',
fullplot: "Charlie is on his way to the USA. He wins in a card game, puts the money in
Edna's bag (she and her sick mother have been robbed of everything). When he
retrieves a little for himself he is accused of being a thief. Edna clears his name.
Later, broke, Charlie finds a coin and goes into a restaurant." }
t
R
es
ou
rc
e
Fo
r
P
as
si
ng
S
uc
ce
ss
fu
lly
You want to sort result set by a relevance score computed by MongoDB in text search
query and extract only three documents with the highest score.
Which query do you need to use?
A. db.movies.find(
{ $text: { $search: 'spaceship' } },
{ score: { $meta: 'textScore' } },
).sort( { score: { $meta: 'textScore' } } )
B. db.movies.find(
{ $text: { $search: 'spaceship' } },
{ score: { $meta: 'textScore' } },
).sort( { score: { $meta: 'textScore' } } ).limit(3)
C. db.movies.find(
{},
{ score: { $meta: 'textScore' } },
).sort( { score: { $meta: 'textScore' } } ).limit(3)
Answer : B
Explanation:
https://docs.mongodb.com/manual/text-search/
https://docs.mongodb.com/manual/core/index-text/
U
pd
at
ed
M
on
go
D
B
C
10
0D
E
V
D
um
ps
V
8.
02
-L
at
es
50.In which of the following CRUD operations can you specify a write concern? Select
all that apply.
A. db.collection.update()
B. db.collection.find()
C. db.collection.insert()
D. db.collection.updateMany()
E. db.collection.insertOne()
Answer : A,C,D,E
Explanation:
https://docs.mongodb.com/manual/reference/write-concern/
51.Which of the following documents are valid JSON format? (select 2)
A. {_id: 1, name: "Riviera Caterer", cuisine: "American"}
B. <"_id": 1, "name": "Riviera Caterer", "cuisine": "American">
C. ["_id": 1, "name": "Riviera Caterer", "cuisine": "American"]
D. {"_id": 1, "name": "Riviera Caterer", "cuisine": "American"}
E. {"_id": 1, "address": {"street": "Stillwell Avenue", "zipcode": "11224"}}
Answer : D,E
Explanation:
While some software may not throw an error, this is still not valid JSON because each
field name should be in quotes:
{_id: 1, name: "Riviera Caterer", cuisine: "American"}
Square brackets instead of curly ones:
["_id": 1, "name": "Riviera Caterer", "cuisine": "American"] The rest of the examples
are self-evident. https://www.mongodb.com/json-and-bson
as
si
ng
S
uc
ce
ss
fu
lly
52.Select all valid BSON types in MongoDB. (select 4)
A. ObjectId
B. Boolean
C. String
D. Array
E. Dictionary
Answer : A,B,C,D
Explanation:
https://docs.mongodb.com/manual/reference/bson-types/
U
pd
at
ed
M
on
go
D
B
C
10
0D
E
V
D
um
ps
V
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
53.In your database there is a collection named companies with the following
document structure:
{
name: 'Wize',
relationships: [
{
is_past: false,
title: 'Head of Product',
person: {
first_name: 'Ethan',
last_name: 'Smith',
permalink: 'ethan-smith'
}
},
{
is_past: true,
title: 'Director, Business Development',
person: {
first_name: 'Stephanie',
last_name: 'Quay',
permalink: 'stephanie-quay'
}
},
{
is_past: true,
title: 'Sr. Engineer',
Fo
r
P
as
si
ng
S
uc
ce
ss
fu
lly
person: {
first_name: 'Stefan',
last_name: 'Antonowicz',
permalink: 'stefan-antonowicz'
}
}
]
}
Which of the following queries should you use to extract all companies that have "CoFounder" title in relationships field (Array)?
A. db.companies.find( { relationships: { $eq: { title: 'Co-Founder' } } } )
B. db.companies.find( { relationships: { $match: { title: 'Co-Founder' } } } )
C. db.companies.find( { relationships: { $elemMatch: { title: 'Co-Founder' } } } )
Answer : C
Explanation:
https://docs.mongodb.com/manual/reference/operator/query/elemMatch/
U
pd
at
ed
M
on
go
D
B
C
10
0D
E
V
D
um
ps
V
8.
02
-L
at
es
t
R
es
ou
rc
e
54.In your database there is a movies collection with the following document
structure:
{
_id: ObjectId("573a1390f29313caabcd42e8"),
genres: [ 'Short', 'Western' ],
title: 'The Great Train Robbery',
rated: 'TV-G',
year: 1903,
imdb: { rating: 7.4, votes: 9847, id: 439 },
countries: [ 'USA' ]
},
{
_id: ObjectId("573a1390f29313caabcd4323"),
genres: [ 'Short', 'Drama', 'Fantasy' ],
rated: 'UNRATED',
title: 'The Land Beyond the Sunset',
year: 1912,
imdb: { rating: 7.1, votes: 448, id: 488 },
countries: [ 'USA' ]
}
In some documents, where there is no rating information for movie, the value is set to
'' (empty string). With that in mind, which of the following queries will return the title
and rating (see below) of top 3 rated movies in this collection?
A. db.movies.find(
{ 'imdb.rating': { $ne: '' } },
uc
ce
ss
fu
lly
{ _id: 0, title: 1, 'imdb.rating': 1 } ).sort( { 'imdb.rating': -1 } ).limit(3)
B. db.movies.find(
{ 'imdb.rating': { $ne: '' } },
{ _id: 0, title: 1, 'imdb.rating': 1 } ).sort( { 'imdb.rating': 1 } ).limit(3)
C. db.movies.find(
{},
{ _id: 0, title: 1, 'imdb.rating': 1 } ).sort( { 'imdb.rating': 1 } ).limit(3)
D. db.movies.find(
{ 'imdb.rating': { $eq: '' } },
{ _id: 0, title: 1, 'imdb.rating': 1 } ).sort( { 'imdb.rating': -1 } ).limit(3)
Answer : A
Explanation:
https://docs.mongodb.com/manual/reference/method/cursor.sort/
M
on
go
D
B
C
10
0D
E
V
D
um
ps
V
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
as
si
ng
S
55.Select all true statements regarding to the _id field in MongoDB documents.
(select 4)
A. When inserting a document, the _id value is already generated as an ObjectId
type, if not directly specified.
B. MongoDB adds an _id field to any inserted document if it doesn't have one.
C. We can select a non ObjectId type value for _id field when inserting a new
document.
D. The _id values must be unique for the collection.
E. The _id can be an array data type.
Answer : A,B,C,D
Explanation:
https://docs.mongodb.com/manual/core/document/
https://docs.mongodb.com/manual/reference/method/ObjectId/
U
pd
at
ed
56.Suppose you have a companies collection in your database. Only the following
documents are stored in
this collection:
{
_id: ObjectId("52cdef7c4bab8bd675297da4"),
name: 'Powerset',
category_code: 'search', founded_year: 2006 },
{
_id: ObjectId("52cdef7c4bab8bd675297da5"),
name: 'Technorati',
category_code: 'advertising',
U
pd
at
ed
M
on
go
D
B
C
10
0D
E
V
D
um
ps
V
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
as
si
ng
S
uc
ce
ss
fu
lly
founded_year: 2002
},
{
_id: ObjectId("52cdef7c4bab8bd675297da7"),
name: 'AddThis',
category_code: 'advertising',
founded_year: 2004
},
{
_id: ObjectId("52cdef7c4bab8bd675297da8"),
name: 'OpenX',
category_code: 'advertising',
founded_year: 2008
},
{
_id: ObjectId("52cdef7c4bab8bd675297daa"),
name: 'Sparter',
category_code: 'games_video',
founded_year: 2007
},
{
_id: ObjectId("52cdef7c4bab8bd675297dac"),
name: 'Veoh',
category_code: 'games_video',
founded_year: 2004
},
{
_id: ObjectId("52cdef7c4bab8bd675297dae"),
name: 'Thoof',
category_code: 'web',
founded_year: 2006
}
How many documents will be deleted when executing the following query?
A. db.companies.deleteMany( { "category_code": "advertising" } )
B. 7
C. 0
D. 3
E. 4
Answer : D
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.deleteMany/
57.Which of the following commands can you use to exports data in BSON format
from a MongoDB cluster?
A. mongodump
B. mongoexport
C. mongostore
D. mongoimport
Answer : A
Explanation:
https://docs.mongodb.com/database-tools/mongodump/
go
D
B
C
10
0D
E
V
D
um
ps
V
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
as
si
ng
S
uc
ce
ss
fu
lly
58.There is a gamers collection in your database with the following document
structure:
{ _id: 1, level: 15, is_active: true },
{ _id: 2, level: 14, is_active: true },
{ _id: 3, level: 7, is_active: false }
How do you increase the value of the level field by 20 for a player with id = 3?
A. Expected result:
B. { _id: 1, level: 15, is_active: true },
C. { _id: 2, level: 14, is_active: true },
D. { _id: 3, level: 27, is_active: false }
E. db.gamers.update( { _id: 3 }, { $inc: { level: 20 } } )
F. db.gamers.update( { _id: 3 }, { $set: { level: 20 } } )
G. db.gamers.update( { _id: 3 }, { $unset: { level: 20 } } )
Answer : E
Explanation:
https://docs.mongodb.com/manual/reference/operator/update/inc/
U
pd
at
ed
M
on
59.Suppose you insert the following documents into a companies collection:
db.companies.insertMany([
{"name": "Facebook"},
{"name": "Twitter"}
])
Select all true statements about this command. (select 3)
A. The _id field is not specified in any of these documents.
B. This command will insert one document into the collection.
C. This command will insert two documents into the collection.
D. MongoDB will automatically create an _id field for each document and it will be
unique.
Answer : A,C,D
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.insertMany/
uc
ce
ss
fu
lly
60.There is a collection named products in MongoDB database. Your coworker wants
to know how many products are in this collection (number of documents in the
collection).
Which query should you use? (select 2)
A. db.products.find().count()
B. db.products.total()
C. db.products.countDocuments()
Answer : A,C
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.count/
https://docs.mongodb.com/manual/reference/method/db.collection.countDocuments/
V
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
as
si
ng
S
61.What is a document in MongoDB?
A. It's an ordered collection of keys (fields) with assigned values. The keys in each
document are strings of characters. Documents in MongoDB cannot contain duplicate
keys.
B. It's a text file containing the configuration of the MongoDB instance.
C. It's a table that contains information about all collections in the database.
Answer : A
U
pd
at
ed
M
on
go
D
B
C
10
0D
E
V
D
um
ps
62.Select true statements regarding to MongoDB. Check all that apply.
A. MongoDB database organizes documents in rows and columns.
B. MongoDB is a NoSQL database that uses documents to store data in an organized
way.
C. Documents in MongoDB are organized into collections.
Answer : B,C
Explanation:
https://www.mongodb.com/what-is-mongodb
63.Which cursor method should you use to return the number of documents in the
result set?
A. cursor.total()
B. cursor.explain()
C. cursor.sum()
D. cursor.count()
Answer : D
Explanation:
https://docs.mongodb.com/manual/reference/method/db.collection.count/
uc
ce
ss
fu
lly
64.What is the built-in database called admin in MongoDB for?
A. The admin database is used to store information about shards in shared MongoDB
cluster.
B. The admin database stores data describing the MongoDB server. For replica sets,
it also stores information about the replication process.
C. The admin database plays an important role in the authentication and authorization
process. Certain
actions performed by administrators also require access to this database.
Answer : C
Explanation:
https://docs.mongodb.com/manual/tutorial/manage-users-and-roles/
um
ps
V
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
as
si
ng
S
65.What is MongoDB Charts?
A. MongoDB product that helps you visualize data stored in an Atlas cluster.
B. A feature that displays data about the performance of your Atlas cluster.
C. An application that allows you to embed on your website visualizations that are
created in other applications.
Answer : A
Explanation:
https://docs.mongodb.com/charts/
U
pd
at
ed
M
on
go
D
B
C
10
0D
E
V
D
66.What is MongoDB Compass?
A. Special data type in MongoDB to store geospatial data.
B. It is a GUI for MongoDB.
C. A map-based chart type that is available with MongoDB Charts.
Answer : B
Explanation:
https://docs.mongodb.com/compass/current/
67.We have an accounts collection with the following document structure:
{
_id: ObjectId("61af47c6e29861661d063714"),
account_id: 1010,
type: 'investment',
limit: 1000000
}
And the following query:
db.accounts.find({
U
pd
at
ed
M
on
go
D
B
C
10
0D
E
V
D
um
ps
V
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
as
si
lly
fu
ss
ce
uc
ng
S
"$or": [
{
"type": {
"$in": [
"investment",
"derivatives"
]
}
},
{
"limit": {
"$gt": 500000
}
}
]
})
Which of the documents below will be retrieved by this query?
A.
{
_id: ObjectId("61af47c6e29861661d067825"),
account_id: 7355,
type: 'commodity',
limit: 500000
}
B.
{
_id: ObjectId("61af47c6e29861661d063357"),
account_id: 1752,
type: 'commodity',
limit: 1000
}
C.
{
_id: ObjectId("61af47c6e29861661d063714"),
account_id: 1010,
type: 'investment',
limit: 1000000
}
D.
{
_id: ObjectId("61af47c6e29861661d063715"),
account_id: 4336,
type: 'derivatives',
limit: 100000
}
Answer : C,D
ng
S
uc
ce
ss
fu
lly
68.Which of the following commands will add a collection that is stored in JSON file to
a MongoDB cluster?
A. mongodump
B. mongoimport
C. mongostore
D. mongoexport
Answer : B
Explanation:
https://docs.mongodb.com/database-tools/mongoimport/
um
ps
V
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
as
si
69.Which cursor method should you use to get information about the query plan?
A. cursor.hint()
B. cursor.explain()
C. cursor.map()
Answer : B
Explanation:
https://docs.mongodb.com/manual/reference/method/cursor.explain/
U
pd
at
ed
M
on
go
D
B
C
10
0D
E
V
D
70.In your database there is a collection named sales with the following document
structure:
{
_id: ObjectId("5bd761dcae323e45a93ccfe8"),
saleDate: ISODate("2015-03-23T21:06:49.506Z"),
items: [
{
name: 'printer paper',
tags: [ 'office', 'stationary' ],
price: Decimal128("40.01"),
quantity: 2
},
{
name: 'notepad',
tags: [ 'office', 'writing', 'school' ],
price: Decimal128("35.29"),
quantity: 2
},
U
pd
at
ed
M
on
go
D
B
C
10
0D
E
V
D
um
ps
V
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
as
si
ng
S
uc
ce
ss
fu
lly
{
name: 'pens',
tags: [ 'writing', 'school', 'stationary' ],
price: Decimal128("56.12"),
quantity: 5
}
],
storeLocation: 'Denver',
customer: { gender: 'M', age: 42, email: 'cauho@witwuta.sv', satisfaction: 4 },
purchaseMethod: 'Online'
}
{
_id: ObjectId("5bd761dcae323e45a93ccfe9"),
saleDate: ISODate("2015-08-25T10:01:02.918Z"),
items: [
{
name: 'binder',
tags: [ 'school', 'general', 'organization' ],
price: Decimal128("28.31"),
quantity: 9
},
{
name: 'backpack',
tags: [ 'school', 'travel', 'kids' ],
price: Decimal128("83.28"),
quantity: 2
}
],
storeLocation: 'Seattle',
customer: { gender: 'M', age: 50, email: 'keecade@hem.uy', satisfaction: 5 },
couponUsed: false,
purchaseMethod: 'Phone'
}
How can you extract all documents from this collection where the first tag in the tags
field (Array) is 'office' in at least one item?
A. db.sales.find( { 'items.tags.[0]': 'office' } )
B. db.sales.find( { 'items.tags$0': 'office' } )
C. db.sales.find( { 'items.tags.0': 'office' } )
Answer : C
Explanation:
https://docs.mongodb.com/manual/tutorial/query-embedded-documents/
71.Select true statements about the naming convention of collections in MongoDB.
A. Empty string '' cannot be a collection name.
B. Collection names should not contain $ sign.
C. Don't create collections that start with system.
Answer : A,B,C
as
si
ng
S
uc
ce
ss
fu
lly
72.Suppose you have a posts collection of documents in your social_app database.
What namespace are these documents stored in?
A. posts.db
B. db.social_app
C. db.posts
D. social_app.posts
E. posts.social_app
Answer : D
C
10
0D
E
V
D
um
ps
V
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
73.Select all true statements regarding to the role of fields and values in a MongoDB
document. (select 2)
A. A field is a unique identifier for a specific data point.
B. You can have duplicate field names within the same level of a single document.
C. Values don't need to be attached to fields and can be standalone data points.
D. Each field has a value associated with it.
Answer : A,D
Explanation:
https://docs.mongodb.com/manual/core/document/
U
pd
at
ed
M
on
go
D
B
74.Can you perform the following operation?
A. db.users.insertOne({})
B. Yes, it will only insert a document with an _id field (auto-generated).
C. No, it will throw an error.
D. Yes, it will only insert a document without any fields.
Answer : B
75.What is the best practice in using the $match operator?
A. The later in the pipeline, the better.
B. The earlier in the pipeline, the better. Not only because we will be using expression
filters which reduce the number of documents to be processed, but also because we
can use indexes.
C. It doesn't matter when we apply $match stage.
Answer : B
Explanation:
https://docs.mongodb.com/manual/reference/operator/aggregation/match/
U
pd
at
ed
M
on
go
D
B
C
10
0D
E
V
D
um
ps
V
8.
02
-L
at
es
t
R
es
ou
rc
e
Fo
r
P
as
si
ng
S
uc
ce
ss
fu
lly
76.Select all true statements regarding to Aggregation Framework.
A. The Aggregation Framework will automatically reorder stages in a certain
conditions (for optimization).
B. The query in a $match stage can not be entirely covered by an index.
Answer : A
Explanation:
https://docs.mongodb.com/manual/aggregation/
GET FULL VERSION OF C100DEV DUMPS
Download