As a newcomer to the programming world, I am currently immersing myself in the development of my initial web application using Node and Express, with connectivity to a MongoDB backend.
In a specific section of my app, users input values into a form that includes selecting one of 30 unique Door types from a list. When the form is submitted, the chosen Door type is queried in the pre-loaded database to retrieve its Weight value. Subsequently, this Weight value is utilized in conjunction with two other user-submitted values (height and width) for a calculation process, facilitated by callback functions upon form submission.
The primary inquiry here pertains to whether streamlining the process might involve storing weights of different door types in a JavaScript object, thus enabling retrieval of the appropriate weight through dot notation. With doors predominantly characterized by name, weight, and one other attribute, this approach could eliminate the necessity of querying the database altogether. Any insights or recommendations on optimizing this workflow?