I am a novice, my query is: I bring data from MongoDb in a table and I want the registration number to appear, I know that there is a function and that it is something very simple to do but as I clarified, I am a novice on the subject and I am learning by I ask that the answers be unstructured and simple. Thank you
function pedirUsuarios (req, res){
req.app.locals.titular=true
User.find({}, (err, socios)=>{
if (err){
res.send (err)
} else{
res.render("usuarios", {socios, titular:req.app.locals.titular , usuario: req.session.user})
}
}).lean()
}
the html of the table:
<table class="table table-hover">
<thead>
<tr class="table-dark">
<th scope="col">Nº Orden</th>
<th scope="col">Apellido</th>
<th scope="col">Nombre</th>
<th scope="col">Direccion</th>
<th scope="col">Altura</th>
<th scope="col">Ciudad</th>
<th scope="col">Estado</th>
<th scope="col">CP</th>
<th scope="col">Email</th>
</tr>
</thead>
{{#each socios}}
<tbody>
<tr>
<th scope="row"></th>
<td>{{apellidoRegistro}}</td>
<td>{{nombreRegistro}}</td>
<td>{{calleRegistro}}</td>
<td>{{alturaRegistro}}</td>
<td>{{ciudadRegistro}}</td>
<td>{{estadoRegistro}}</td>
<td>{{cpRegistro}}</td>
<td>{{emailRegistro}}</td>
</tr>
{{/each}}
</tbody>
</table>
I want it to appear in order: 1 2 3 4 5