Apply proper formatting on Note paragraph (#38120)
parent
fda7fb174e
commit
7453131461
|
@ -16,7 +16,7 @@ In the good old days this was what you needed to do if you wanted to edit a docu
|
|||
|
||||
Find a person by <code>_id</code> ( use any of the above methods ) with the parameter <code>personId</code> as search key. Add "hamburger" to the list of the person's <code>favoriteFoods</code> (you can use <code>Array.push()</code>). Then - inside the find callback - <code>save()</code> the updated <code>Person</code>.
|
||||
|
||||
<strong>Note:</strong> This may be tricky, if in your Schema, you declared <code>favoriteFoods</code> as an Array, without specifying the type (i.e. <code>[String]</code>). In that <code>casefavoriteFoods</code> defaults to Mixed type, and you have to manually mark it as edited using <code>document.markModified('edited-field')</code>. See [Mongoose documentation](https://mongoosejs.com/docs/schematypes.html#Mixed)
|
||||
<strong>Note:</strong> This may be tricky, if in your Schema, you declared <code>favoriteFoods</code> as an Array, without specifying the type (i.e. <code>[String]</code>). In that case, <code>favoriteFoods</code> defaults to Mixed type, and you have to manually mark it as edited using <code>document.markModified('edited-field')</code>. See [Mongoose documentation](https://mongoosejs.com/docs/schematypes.html#Mixed)
|
||||
|
||||
</section>
|
||||
|
||||
|
|
Loading…
Reference in New Issue