Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit c4ee8dd5
authored
Oct 17, 2015
by
Trey Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix documentation/comments for Model.findById
1 parent
1c72bc93
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
lib/model.js
lib/model.js
View file @
c4ee8dd
...
...
@@ -1440,19 +1440,19 @@ Model.$findSeparate = function(results, options) {
};
/**
* Search for a single instance by its primary key.
This applies LIMIT 1, so the listener will always be called with a single instance.
* Search for a single instance by its primary key.
*
* @param {Number|String|Buffer}
[options] A hash of options to describe the scope of the search, or a number to search by id
.
* @param {Object}
'
[options]
* @param {Number|String|Buffer}
id The value of the desired instance's primary key
.
* @param {Object}
[options]
* @param {Transaction} [options.transaction] Transaction to run query under
* @param {String} [options.searchPath=DEFAULT] An optional parameter to specify the schema search_path (Postgres only)
*
* @see {Model#findAll} for a
n
explanation of options
* @see {Model#findAll} for a
full
explanation of options
* @return {Promise<Instance>}
* @alias findByPrimary
*/
Model
.
prototype
.
findById
=
function
(
param
,
options
)
{
//
For sanity findById will never return if no option
s are passed
//
return Promise resolved with null if no argument
s are passed
if
([
null
,
undefined
].
indexOf
(
param
)
!==
-
1
)
{
return
Promise
.
resolve
(
null
);
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment