I want to populate dropdown field in htlm page from mongodb rather than hardcode values
I'm using below stack of technologies: 1) EJS/CSS 2) NodeJS 3) Mongodb
I have created a page where user can create new records. This page having few dropdown fields like Area which should fetch values from collection - Area- of mongodb. For now I have done hardcode to populate the values but I want the values being fetched from database.
Could you please guide me how to achieve with sample code.
Appreciate your response.
Regards, Parag
<tr>
<td>Component Area </td>
<td><input type="text" name="comparea" /></td>
</tr>
I want to populate this area field from mongodb collection.