obj «Object» the value to cast to this arrays SubDocument schema Creates a subdocument casted to this schema.
This is the same subdocument constructor used for casting.
id «ObjectId|String|Number|Buffer» Searches array items for the first document with a matching _id.
const embeddedDoc = m.array.id(some_id);
Helper for console.log
[...args] «Object» Pulls items from the array atomically.
[...args] «Object» Wraps Array#push with proper change tracking.
[options] «Object» optional options to pass to each documents toObject method call during conversion Returns a native js Array of plain js objects
Each sub-document is converted to a plain object by calling its #toObject method.
© 2010 LearnBoost
Licensed under the MIT License.
https://mongoosejs.com/docs/api/mongoosedocumentarray.html