Halloween Sale Special - 75% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: estly75

You perform the following operation in the shell: db.foo.insert( { } ); What gets inserted?

A.

A document will be inserted with the same _id as the last document inserted

B.

A document that matches the collection ' s existing schema, but with null fields

C.

A document with an _id assigned to be an Objectld

D.

An empty document

E.

No document will be inserted; an error will be raised

If the value of totalKeysExamined is 30000 and the value of totalDocsExamined is 0, which of the following option is correct?

A.

None of the above

B.

The query used an index to fetch the results

C.

The query returned 0 documents

D.

The query returned 30000 documents after scanning the documents

What is the replication factor for a replicated cluster with 1 primary, 3 secondaries with one of them hidden. The set also has an arbiter?

A.

None of the above

B.

5

C.

3

D.

4

Which operations add new documents to a collection?

A.

Create

B.

update

C.

insert

D.

delete

The difference between $push and $addToSet is:

A.

$addToSet needs the fields to be already present while $push will work even if the field is not present

B.

$addToSet adds the item to the field only if it does not exist already; while $push pushes the item to the field irrespective of whether it was present or not

C.

$addToSet adds the item to the field only if the new item is of the same datatype

D.

There is no major difference between them. $addToSet is a deprecated version of $push.

A collection named products contains the following documents:

{ " _id " : 1, " name " : " Laptop " , " price " : 1500 }

{ " _id " : 2, " name " : " Smartphone " , " price " : 800 }

{ " _id " : 3, " name " : " Tablet " , " price " : 600 }

{ " _id " : 4, " name " : " Monitor " , " price " : 300 }

{ " _id " : 5, " name " : " Headphones " , " price " : 200 }

Given the following query:

db.products.find().sort({ " price " : -1 }).limit(2)

What is the expected output?

A.

Laptop (1500) and Smartphone (800).

B.

Monitor (300) and Headphones (200).

C.

All five documents in descending price order.

D.

Headphones (200) and Monitor (300).

In which of the following scenarios is sharding not the correct option. Select all that apply.

A.

The write operations on the collection are low

B.

The write operations on the collection are very high

C.

The working set in the collection is expected to grow very large in size

D.

The collection is a read intensive collection with less working set

A user stores movie data in a collection called movies. The collection contains thousands of documents.

A sample document looks like this:

{ " title " : " Titanic " , " year " : 1997, " rating " : 8.6 }

The user runs the following query to sort movies first by year, and then by rating:

db.movies.find().sort({ " year " : 1, " rating " : -1 })

Which index would improve the query ' s performance the MOST?

A.

db.movies.createIndex({ " year " : 1, " title " : 1, " rating " : -1 })

B.

db.movies.createIndex({ " year " : -1, " rating " : 1 })

C.

db.movies.createIndex({ " rating " : 1, " year " : -1 })

D.

db.movies.createIndex({ " rating " : -1, " year " : 1 })

What command returns all documents in an orders collection where quantity is less than or equal to 1000 and salesRep is not equal to " Anne " ?

A.

db.orders.find({ " quantity " : { $lte: 1000 }, salesRep: { $neq: " Anne " } })

B.

db.orders.find({ " quantity " : { $lt: 1000 }, salesRep: { $ne: " Anne " } })

C.

db.orders.find({ " quantity " : { $lte: 1000 }, salesRep: { $ne: " Anne " } })

D.

db.orders.find({ " quantity " : { $lt: 1000 }, salesRep: { $neq: " Anne " } })

Below is a sample document of " orders " collection

question 30

A.

$sort