Understanding the Document Object

When you use the Model object to retrieve documents from a database, the documents are presented in the callback function as Mongoose Document objects. Document objects inherit from the Model class and represent the documents in a collection. The Document object allows you to interact with a document from the perspective of your schema model by providing a number of methods and extra properties that support validation, modifications, etc.

Table 16.5 lists the most useful methods and properties on the Document object.

Image
Image

Table 16.5 Methods and properties available on Document objects

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.128.206.8