The API prototype.unmarkModified() method of the Mongoose API is used to clear the modified state on the specified path of any object. In other words,… Read More
Tag Archives: Mongoose-API
The API prototype.save() method of the Mongoose API is used to save the document into the collection. If the document is already present in the… Read More
The API prototype.overwrite() method of the Mongoose API is used to overwrite the existing document object in the collection. It is used to update or… Read More
The Model.listIndexes() method of Mongoose API Lists the indexes currently defined in MongoDB, whether they are the promise, undefined or void. Syntax: Model_Name.listIndexes() Parameters: The… Read More
The API prototype.updateOne() of the Mongoose API is used to update documents in a collection. This method can be used on mongoose documents and on… Read More
The Model.init() method of Mongoose API is responsible for building indexes. Although, Mongoose calls this function automatically when a model is created using mongoose.model() or… Read More
The prototype.replaceOne() method of the Mongoose API is used to replace field values of any document present in the collection. We can use replaceOne() on… Read More
The prototype.update() method of the Mongoose API can be used to update the document in a collection. It can be used on a document object… Read More
The Model.deleteOne() method of the Mongoose API is used to delete a document from the collection. We can provide an object of the field to… Read More
The Model.deleteMany() method of the Mongoose API is used to delete more than one document in the collection at a time in one go. We… Read More
The Model.prototype.collection property of the Mongoose API is used to display collection-related information on any model. It showcases collections that are being used by models.… Read More
The Model.count() method of the Mongoose API is used to count the number of documents present in the collection based on the given filter condition.… Read More
The Model.bulkWrite() method of the Mongoose API is used to perform multiple operations in one command. It can insert multiple documents, can update one or… Read More
The Model.prototype.baseModelName property of the Mongoose API is used to return the baseModelName as the name of the base model, if this is a discriminator… Read More
The Model.prototype.discriminators property of the Mongoose API is used to return the registered discriminators for the model. Syntax: Model_Name.discriminators Returns: The Model.prototype.discriminators property returns the… Read More