req.allParams()

Returns the value of all parameters sent in the request, merged together into a single object. Includes parameters parsed from the url path, the query string, and the request body. See req.param() for details.

Usage

  1. req.allParams();

Example

Update the product with the specified sku, setting new values using the parameters which were passed in:

  1. var values = req.allParams();
  2. // Don't allow `price` or `isAvailable` to be edited.
  3. delete values.price;
  4. delete values.isAvailable;
  5. // At this point, `values` might look something like this:
  6. // values ==> { displayName: 'Bubble Trouble Bubble Bath' }
  7. Product.update({sku: sku})
  8. .set(values)
  9. .then(function (newProduct) {
  10. // ...
  11. });

Notes

  • This method can also be called as req.params.all() - they are synonyms.