0% found this document useful (0 votes)
60 views4 pages

C100DEV

The document discusses MongoDB concepts like why it is considered a NoSQL database, how to create text indexes and perform text searches, extract data from arrays, and use the $slice operator. It also covers that the local database in MongoDB stores data describing the server and for replica sets also stores replication process information.

Uploaded by

Shruti Tiwari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views4 pages

C100DEV

The document discusses MongoDB concepts like why it is considered a NoSQL database, how to create text indexes and perform text searches, extract data from arrays, and use the $slice operator. It also covers that the local database in MongoDB stores data describing the server and for replica sets also stores replication process information.

Uploaded by

Shruti Tiwari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Http://www.passcert.

com
The safer , easier way to help you pass any IT exams.

Exam : C100DEV

Title : MongoDB Certified


Developer Associate

Version : DEMO

1 / 3
The safer , easier way to help you pass any IT exams.

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

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 ] }, '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 } } )

2 / 3
The safer , easier way to help you pass any IT exams.

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/

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/

3 / 3

You might also like