Returns the value of all parameters sent in the request, merged together into a single dictionary (plain JavaScript object). Includes parameters parsed from the url path, the query string, and the request body. See req.param()
for details.
req.allParams();
Update the product with the specified sku
, setting new values using the parameters which were passed in:
var values = req.allParams();
// Don't allow `price` or `isAvailable` to be edited.
delete values.price;
delete values.isAvailable;
// At this point, `values` might look something like this:
// values ==> { displayName: 'Bubble Trouble Bubble Bath' }
Product.update({sku: sku})
.set(values)
.exec(function (err, newProduct) {
// ...
});
- This method can also be called as
req.params.all()
- they are synonyms.