MongoDB Associate Database Administrator v1.0

Page:    1 / 11   
Exam contains 152 questions

What mongosh function displays the indexes associated with the pets collection?

  • A. db.pets.getIndexes()
  • B. db.pets.showAllIndexes()
  • C. db.pets.indexesCollDetails()
  • D. db.pets.indexDetails()


Answer : A

The book collection needs to update the value of the recorder field to true for all documents with a stock value less than 10.
What command should be used in mongosh?

  • A. db.books.updateMany({ stock: { $lt: 10 } }, { $set: { reorder: true } })
  • B. db.books.update_Many({ stock: { $lt: 10 } }, { $set: { reorder: true } })
  • C. db.books.update({ stock: { $lt: 10 } }, { $set: { reorder: true } }, { $multi: true })
  • D. db.books.updateOne({ stock: { $lt: 10 } }, { $set: { reorder: true } }, { multi: true })


Answer : A

Given the following query:
db.tests.find(
{ points: { $elemMatch: { $gte: 75, $lt: 80 } } }
)
Which two documents from collections tests will be returned by this query? (Choose two.)

  • A. { _id: 1, points: [ 80, 87, 88 ] }
  • B. { _id: 2, points: [ 70, 87, 88 ] }
  • C. { _id: 4, points: [ 76, 77, 79 ] }
  • D. { _id: 3, points: [ 75, 88 ] }
  • E. { _id: 5, points: 77 }


Answer : CD

Given the following sample documents in the inventory collection:
{ _id: 6305, name: “A.S.”, “assignment” : 5, “points” : 24 },
{ _id: 6308, name: “B.M.”, “assignment” : 3, “points” : 22 },
{ _id: 6312, name: “E.M.”, “assignment” : 5, “points” : 30 },
{ _id: 6319, name: “R.S.”, “assignment” : 2, “points” : 12 },
{ _id: 6322, name: “A.S.”, “assignment” : 2, “points” : 14 },
{ _id: 6234, name: “R.S.”, “assignment” : 1, “points” : 10 },
{ _id: 6235, name: “A.S.”, “assignment” : 1, “points” : 30 },
{ _id: 6315, name: “E.M.”, “assignment” : 3, “points” : 14 },
What will delete only the document which stores “E.M.” lowest “points”, and returns the deleted document?

  • A. db.inventory.deleteOne({ “name” : “E.M.” }, { sort : { “points” : 1 } })
  • B. db.inventory.findOneAndDelete({ “name” : “E.M.” }, { sort : { “points” : -1 } })
  • C. db.inventory.deleteOne({ “name” : “E.M.” }, { sort : { “points” : -1 } })
  • D. db.inventory. findOneAndDelete({ “name” : “E.M.” }, { sort : { “points” : 1 } })


Answer : D

Given the following Java code:

What Java code inserts this document?

  • A. collection.insertone(document);
  • B. document.insertone(collection);
  • C. collection.insertOne(document);
  • D. document.insertOne(collection);


Answer : C

A collection named products contains 100 documents.
What method should be used to get all results from a cursor using mongosh?

  • A. db.products.findAll();
  • B. db.products.forEach().toArray();
  • C. db.products.find().toArray();
  • D. db.products.find()[];


Answer : C

In an employee collection, each document represents an employee of the company.
What data model is the most effective for tracking the relationship between an employee and their manager?

  • A. Reference array to employee documents in each manager document
  • B. Embed manager document into each employee document
  • C. Embed employee documents as an array into each manager document
  • D. Reference to manager document in each employee document


Answer : D

What is the best practice for connecting to a MongoDB cluster with the Java Driver?

  • A. A single, cached MongoClient instance
  • B. A new MongoClient instance for each logical transaction
  • C. A new MongoClient instance for each request
  • D. A pool of MongoClient instances to allow multiple concurrent database requests


Answer : A

Given the following documents in the orders collection:
{ _id: 0, user: “E.A.”, items: [ { item: “bag” } ], status: “Shipped” },
{ _id: 1, user: “M.T.”, items: [ { item: “polo”, size: 10 } ], status: “Order in Progress” },
{ _id: 2, user: “S.R.”, items: [ { item: “jacket”, size: 6 } ], { item: “polo”, size: 6 } ], status: “Order Placed” },
{ _id: 3, user: “T.C.”, items: [ { item: “polo”, size: 8 } ], { item: “pants”, size: 8 } ], status: “Order in Progress” },
{ _id: 4, user: “A.B.”, items: [ { item: “bag” }, { item: “jacket”, size: 8 } ], status: “Order Placed” },
{ _id: 5, user: “L.C.”, items: [ { item: “hat”, size: “S” } ], status: “Shipped” }
What mongosh command will find a document with status order placed?

  • A. db.orders.find_one( {status:”Order Placed”} )
  • B. db.orders.findOne( {status:”Order Placed”} )
  • C. db.orders.findone( {status:”Order Placed”} )
  • D. db.orders.find_One( {status:”Order Placed”} )


Answer : B

Given the following documents in a collection and given a unique index on the n field:
{ _id: 1, n: ‘Apple’, p: 0.75, c: ‘Green’ },
{ _id: 2, n: ‘Orange’, p: 0.85, c: ‘Orange’, q: 14 },
{ _id: 3, n: [1,3,5,7], c: 42 },
{ _id: 9, n: Green, c: 42 }
What document can successfully be added in the same collection?

  • A. { _id: 4, n: ‘Banana’, p: 0.75, c: ‘Yellow’ }
  • B. { _id: 5, n: ‘Apple’, p: 0.85, c: ‘Orange’, q: 14 }
  • C. { _id: 3, n: ‘Mango’, c: 42}
  • D. { _id: 2, n: ‘Banana’, p: 0.75, c: ‘Green’ }


Answer : A

Given the following explain plan:

What statement is true for this explain plan?

  • A. This is using an index.
  • B. This has a sort stage with index support.
  • C. This is not using an index.
  • D. This uses an index in reverse direction.


Answer : C

There is a collection of patients for a medical practice.
Which two attributes associated with the patient should be embedded into the patient document rather than stored in its own collection and referenced? (Choose two.)

  • A. Visits to the practice
  • B. Current prescriptions
  • C. Diagnosed conditions
  • D. Their primary doctor


Answer : BC

Given the following query:
db.restaurants.find({“borough” : “Brooklyn”, “grades.score” : {$gt:5}})
No index exists for the restaurant collection.
What index definition most improves the performance?

  • A. db.restaurants.createIndex({“borough” : 1, “grades.score” : 1} )
  • B. db.restaurants.createIndex({“grades.score” : 1, “borough” : 1} )
  • C. db.restaurants.createIndex({“borough” : 1} )
  • D. db.restaurants.createIndex({“grades.score” : 1} )


Answer : A

Given the following documents in the employees collection:
{ _id: 0, name: “Y.B.”, department: “Sales” },
{ _id: 1, name: “E.H.”, department: “Engineering” },
{ _id: 2, name: “C.Y.”, department: “Support” },
What mongosh command will find a document with name “E.H”?

  • A. db.employees.query_one( {name: “E.H.”} )
  • B. db.employees.find_one( {name: “E.H.”} )
  • C. db.employees.queryOne( {name: “E.H.”} )
  • D. db.employees.findOne( {name: “E.H.”} )


Answer : D

A products collection needs to update the value of the qty field to 100 for a document with a “card” item value. It should insert a new document if it does not exist.
What command should be used?

  • A. db.products.updateOne({ item: “card”} , { $set: { qty: 100 } }, { $upsert: true })
  • B. db.products.inserteOne( { item: “card”} , { $set: { qty: 100 } }, { upsert: true })
  • C. db.products.insertOne( { item: “card”} , { $set: { qty: 100 } }, { $upsert: true })
  • D. db.products.updateOne({ item: “card”} , { $set: { qty: 100 } }, { upsert: true })


Answer : D

Page:    1 / 11   
Exam contains 152 questions

Talk to us!


Have any questions or issues ? Please dont hesitate to contact us

Certlibrary.com is owned by MBS Tech Limited: Room 1905 Nam Wo Hong Building, 148 Wing Lok Street, Sheung Wan, Hong Kong. Company registration number: 2310926
Certlibrary doesn't offer Real Microsoft Exam Questions. Certlibrary Materials do not contain actual questions and answers from Cisco's Certification Exams.
CFA Institute does not endorse, promote or warrant the accuracy or quality of Certlibrary. CFA® and Chartered Financial Analyst® are registered trademarks owned by CFA Institute.
Terms & Conditions | Privacy Policy | Amazon Exams | Cisco Exams | CompTIA Exams | Databricks Exams | Fortinet Exams | Google Exams | Microsoft Exams | VMware Exams