
«Object» Options passed down to save().docs «Array|Object» Documents to insert, as a spread or array.$nearSphere: $geoWithin with $centerSphere.The countDocuments() function is similar to count(), but there are aįew operators that countDocuments() does not support.īelow are the operators that count() supports but countDocuments() does not, ), MongoDB will always executeĪ full collection scan and not use any indexes. Find the max balance of all accounts const res = await Users. This function triggers the following middleware. If a callback is not passed, the aggregate itself is returned. If a callback is passed, the aggregate is executed and a Promise is returned. Performs aggregations on the models collection. If true, mongoose doesn't add an _id field to the document. You do not need to set this parameter to ensure Mongoose handles your query projection. «Object» optional object containing the fields that were selected in the query which returned this document.
