C100DBA

Review 152 C100DBA practice questions with answer explanations and community insights.

Question 1

An Atlas Sample Dataset of restaurants is loaded into a database deployment.How is Data Explorer used to find all restaurants whose name is “The Rose Palace” in the Restaurants database?

  1. Select the collection on the left-hand side.Select the “Aggregation” view.Specify the first stage as $match query: {name: “The Rose Palace”}Specify the following query: “$limit: 1”.
  2. Select the collection on the left-hand side.Select the “Find” view.Select “Filter” and type {name: “The Rose Palace”}Click “Find” to run the query.
  3. MongoDB Data Explorer is primarily used to insert/edit/delete documents, not find them.
  4. Select the collection on the left-hand side.Select the “Find” view.Select “Filter” and type {name == “The Rose Palace”}Click “Find” to run the query.

Question 2

Given the following query:db.coll.find({}).sort({“income”: 1, “tax”: -1})Which two indexes will improve the performance of this query the most? (Choose two.)

  1. {“income”: -1, “tax”: -1}
  2. {“income”: -1, “tax”: 1}
  3. {“income”: 1, “tax”: -1}
  4. {“income”: 1, “tax”: 1}

Question 3

Given the following sample documents:{_id:1, company: “Farm Inc.”, active: true},{_id:2, company: “Garden Inc.”, active: false}A developer wants to create a search query to search for a company. There is a business requirement to accommodate misspellings. An Atlas Search index has already been created for this query.What query satisfies these requirements?

  1. db.users.aggregate({$search: {“text”: {“path”: “company”, “query”: “Gardin” }})
  2. db.users.aggregate({$search: {“text”: {“path”: “company”, “query”: “Gardin”, “misspelled”: true}})
  3. db.users.aggregate({$search: {“text”: {“path”: “company”, “query”: “Gardin”, “fuzzy”: {}}})
  4. db.users.aggregate($search: {“company”, “Gardin”, true})

Question 4

Given the following documents in a collection:{_id:1, a: “one”, b: “two”}{_id:2, a: “two”, b: “three”}{_id:3, a: “one”, b: “four”, c: “three”}Using the following update command:db.coll.replaceOne({a: “one”}, {d: “two”, b: “five”})What would the contents of the collection be after successfully running this command?

  1. {_id:1, d: “two”, b: “five”}{_id:2, a: “two”, b: “three”}{_id:3, a: “one”, b: “four”, c: “three”}
  2. {_id:1, a: “one”, b: “five”}{_id:2, a: “two”, b: “three”}{_id:3, a: “one”, b: “four”, c: “three”}
  3. {_id:1, a: “one”, d: “two”, b: “five”}{_id:2, a: “two”, b: “three”}{_id:3, a: “one”, b: “four”, c: “three”}
  4. {_id:1, d: “two”, b: “five”}{_id:2, a: “two”, b: “three”}{_id:3, d: “two”, b: “five”}

Question 5

Given the following match expression:{“c”: {$eq: “Green”}, “a”: {$gt: 3}}{ _id: 1, p: 0.75, c: ‘Green’, a: [1,3,5,7]},{ _id: 2, p: 0.80, c: ‘Orange, a: [1,3]},{ _id: 3, p: 0.13, c: [‘Green’, ‘Orange’], a: [3]},{ _id: 4, p: 0.00, c: ‘Green’, a: [5,7]},{ _id: 5, p: 0.04, c: ‘Green’, a: 3},{ _id: 6, p: 0.97, c: ‘Red, a:5}What document will be returned from this expression?

  1. { _id: 1, p: 0.75, c: ‘Green’, a: [1,3,5,7]},{ _id: 2, p: 0.80, c: ‘Orange, a: [1,3]},{ _id: 4, p: 0.00, c: ‘Green’, a: [5,7]}
  2. { _id: 4, p: 0.00, c: ‘Green’, a: [5,7]}
  3. { _id: 1, p: 0.75, c: ‘Green’, a: [1,3,5,7]},{ _id: 3, p: 0.13, c: [‘Green’, ‘Orange’], a: [3]},{ _id: 4, p: 0.00, c: ‘Green’, a: [5,7]},{ _id: 5, p: 0.04, c: ‘Green’, a: 3},{ _id: 6, p: 0.97, c: ‘Red, a:5}
  4. { _id: 1, p: 0.75, c: ‘Green’, a: [1,3,5,7]},{ _id: 4, p: 0.00, c: ‘Green’, a: [5,7]}
We are moving to a new platform

CertificationTest is being migrated. Some pages may be slow or briefly unavailable; everything will be back to normal within a few hours. If you run into any issue, email support@certificationtest.net.