In a sharded replica set environment, the w Option provides ability for write concern and j Option provides ability for the data to be written on disk journal. Consider that we have a seven member replica set and we want to assure that the writes are committed to journal. What should be the value of j?
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?
Given the following query:
db.load.find({
_id: { $lte: 1000 },
rnd: 1234,
date: { $gte: ISODate( " 2023-01-01 " ) }
}).sort({ date: -1 })
In a compound index that best supports this query, what field should be first field?