Mongoose static methods:
- Model.create(data)
- Model.insertMany(arr)
- Model.find()
- find all documents in a collection
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.