Mongoose static methods:
- Model.create(data)
- Model.insertMany(arr)
- Model.find(filter)
- If the filter is not provided or an empty object: it returns all the documents in a collection (example:
Pizza.find()
)
Form elements such as <input>
, <textarea>
, and <select>
naturally keep some internal state (and change based on user's input).
From the React team: > In most cases, we recommend using controlled components to implement forms. In a controlled component, form data is handled by a React component.