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.
Hi, I was reading the docs and I found that the documentation for the
findOrCreatemethod inPersistedModelis wrong. It states that the callback function has 2 arguments,errorandinstance, 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), wherecreatedistrueif the instance was just created orfalseif it was found.I'm using loopback's version
2.14.0but, 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.