Update remote method example

This commit is contained in:
Ritchie 2013-09-25 10:52:15 -07:00
parent ba5814aeff
commit 6695a338d3
1 changed files with 6 additions and 5 deletions

View File

@ -511,12 +511,13 @@ Expose a remote method.
```js
Product.stats = function(fn) {
var calc = require('./stats');
var statsResult = {
totalPurchased: 123456
};
var err = null;
Product.find(function(err, products) {
var productStats = calc(products);
fn(null, productStats);
});
// callback with an error and the result
fn(err, statsResult);
}
loopback.remoteMethod(