How do I obtain the sum of a Loopback PersistedModel?
There does not seem to be a documentation on how to achieve that.
If possible I would like to avoid ha
Aggregate query with loopback
Products.getDataSource().connector.connect(function(err, db) { var collection = db.collection('Products'); collection.aggregate( [{ $match: { "productCode" : "WIN10-NoOS" } }] ).toArray(function(err,servicesData){ if(err){ }else{ cb(null,servicesData); } }); });