new to MEAN stack here,
I'm trying to insert datas into MongoDB, but with the _id of the connected user, so I have a function which display it :
getSessionInfos(){
return sessionStorage.getItem('id');
}
db.collection('transactions').insertOne({
date : req.body.date,
titre: req.body.titre,
description : req.body.description,
montant : "-" + req.body.montant,
id: req.body.id, <-------------
type: "debit"
So I thought to myself, alright, I'm gonna create a hidden input with the ID as a value, it's gonna be easier :
<input type="text" [(ngModel)]="data.id" value="getSessionInfos()">
Except that NO, it seems that you can't change the value of a NGmodel input, So how am I supposed to do that ?
Thanks a lot