Skip to content

[Docs] Incorrect callback arguments in PersistedModel#findOrCreate #1528

Description

@Jhoanegar

Hi, I was reading the docs and I found that the documentation for the findOrCreate method in PersistedModel is wrong. It states that the callback function has 2 arguments, error and instance, as you can see here.
http://apidocs.strongloop.com/loopback/v/2.14.0/#persistedmodel-findorcreate

According to my tests, the callback function actually gets three arguments, (error, created, instance), where created is true if the instance was just created or false if it was found.

I'm using loopback's version 2.14.0 but, unless the signature changed in the latest version, I see the same mistake in the latest docs. That or I'm overlooking something.

Keep the awesome work.
Cheers.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions