Skip to content

Commit f285ad3

Browse files
committed
fix(docs): clarify defaultFn
Signed-off-by: Muhammad Aaqil <aaqilcs102@gmail.com>
1 parent 57bae5b commit f285ad3

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

docs/site/Model.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,18 @@ Here are general attributes for property definitions:
523523
<li><code>"uuidv4"</code>: generate a new universally unique identifier using the UUID version 4 algorithm.</li>
524524
<li>"<code>now"</code>: use the current date and time as returned by <code>new Date()</code></li>
525525
</ul>
526-
NOTE: the value of <code>defaultFn</code> is generated by LoopBack itself. If you'd like to use database built-in <code>uuid</code> functions (MySQL or Postgres for example), please check the README file of the corresponding connector.
526+
NOTES:
527+
<ul>
528+
<li>
529+
the value of <code>defaultFn</code> is generated by LoopBack itself. If you'd like to use database built-in <code>uuid</code> functions (MySQL or Postgres for example), please check the README file of the corresponding connector.
530+
</li>
531+
<li>
532+
don't set <code>generated</code> to <code>true</code> incase of <code>defaultFn</code> as <code>generated</code> property indicates the value to be generated by the database not by Loopback.
533+
</li>
534+
<li>
535+
don't set <code>required</code> to <code>true</code> incase of <code>defaultFn</code> as <code>required</code> means the user needs to provide the field in the request always.
536+
</li>
537+
</ul>
527538
</td>
528539
</tr>
529540
<tr>

0 commit comments

Comments
 (0)