fix(curriculum): format challenge markdown as per linting rules (#36326)
* fix: Format challenge markdown according to linting rules * fix: Put spaces after section tags
This commit is contained in:
committed by
mrugesh
parent
c387873640
commit
7d4dc382b4
@ -6,14 +6,16 @@ challengeType: 2
|
||||
|
||||
## Description
|
||||
<section id='description'>
|
||||
|
||||
In the good old days this was what you needed to do if you wanted to edit a document and be able to use it somehow e.g. sending it back in a server response. Mongoose has a dedicated updating method : <code>Model.update()</code>. It is bound to the low-level mongo driver. It can bulk edit many documents matching certain criteria, but it doesn’t send back the updated document, only a ‘status’ message. Furthermore it makes model validations difficult, because it just directly calls the mongo driver.
|
||||
</section>
|
||||
|
||||
## Instructions
|
||||
<section id='instructions'>
|
||||
|
||||
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 at 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 <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)
|
||||
|
||||
</section>
|
||||
|
||||
|
Reference in New Issue
Block a user