C100DBA practice questions, page 6 of 6, with answer review and explanations.
Question 26
A collection has the following documents:{_id: 1, firstName: “John”, hobbies: “likes sports, go to the movies, and bird watching “}{_id: 2, firstName: “Jane”, hobbies: “likes to ride a bike and hiking“}{_id: 3, firstName: “Alice”, hobbies: “likes to watch movies and kite flying“}A text search query follows the pattern “find all people whose hobbies are ‘movies’”.What Atlas Search index supports the requirements above?
What Java statement finds and returns a single document?
coll.findOne(eq(“hello”, “world”));
coll.findOne(“hello”, “world”);
coll.find({“hello”: “world”}).first();
coll.find(eq(“hello”, “world”)).first();
Question 28
The zip_entries collection contains documents with population information for cities within states.Given the following sample document from this collection:{_id: “36784”city: “THOMASVILLE”,state: “AL”,pop: 6229}What Java method can be used to return a list of states whose total population across all cities is over 2 million?
Question 29
What returns the number of documents matching a given query?
Given the following documents in a collection:{ _id: 1, n: ‘Apple’, p: 0.75, c: ‘Green’, q: 14 },{ _id: 2, n: [1,3,5,7], c: 14 },{ _id: 3, n: ‘Orange’, p: 0.85, c: ‘Orange’, q: 14 }Which two documents can successfully be added in the same collection? (Choose two.)