Complete the code to get the estimated number of documents in the collection.
const count = await collection.[1]();The estimatedDocumentCount() method quickly returns an estimate of the total number of documents in a collection without scanning the entire collection.
Complete the code to print the estimated document count from the collection.
collection.[1]().then(count => console.log(count));estimatedDocumentCount() returns a promise that resolves to the estimated number of documents, which we print.
Fix the error in the code to get the estimated document count correctly.
const count = await collection.[1];The method estimatedDocumentCount() must be called with parentheses to execute and return a promise.
Fill both blanks to estimate the document count and handle errors.
collection.[1]().catch(error => console.[2](error));
Use estimatedDocumentCount() to get the count and console.error to print errors.
Fill all three blanks to estimate document count, assign it to a variable, and print it.
async function getCount() {
const count = await collection.[1]();
console.[2]('Estimated count:', [3]);
}Call estimatedDocumentCount() to get the count, then use console.log to print the variable count.