From ccf0e94dc5af348d0ac70879c23d6c268246af38 Mon Sep 17 00:00:00 2001 From: Wendy Sung <35469813+sungsauce@users.noreply.github.com> Date: Wed, 1 May 2019 00:34:40 -0400 Subject: [PATCH] Update findById to findByPk See https://github.com/sequelize/sequelize/commit/1bc8b0e82d4635ff22cbd4c048c042fed30a036f --- docs/querying.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/querying.md b/docs/querying.md index aaae2c0..40145c5 100644 --- a/docs/querying.md +++ b/docs/querying.md @@ -14,13 +14,13 @@ console.log(foundPug) ``` -## Model.findById +## Model.findByPk [Official Docs](http://docs.sequelizejs.com/manual/tutorial/models-usage.html#-find-search-for-one-specific-element-in-the-database) -Finds the instance with the specified id. +Finds the instance with the specified Primary Key (id). ```javascript -pugWithIdOne = await Pug.findById(1) +pugWithIdOne = await Pug.findByPk(1) console.log(pugWithIdOne) ``` @@ -79,4 +79,4 @@ console.log(sevenYearOldBlackPugs) ``` -**Note**: To specify comparisons like "greater than" and "less than", Check out [Search Operators](/search-operators). \ No newline at end of file +**Note**: To specify comparisons like "greater than" and "less than", Check out [Search Operators](/search-operators).