I am trying to display an input area in a Jade file with pre-populated data gathered from the session info being stored in mongodb session store. The web app is built on Express for node.js. My Jade file looks like this with the input area (pre-populated with session data):
input(name='username', value='#{username}')
So the input area is displaying the correct username stored in the session. Then, I want the user to be able to edit that field and submit a new username if desired. My mongodb update() looks like this:
uname = request.body.username;
targetcol.update({username: req.session.username, password: req.session.password}, {username: uname});
Once submitted however, the document in the mongodb collection for the related profile is not being updated, it's keeping the same value that's been pre-populated. I'm wondering if this is because I'm assigning it as a value=
in the Jade file? Any advice on what is wrong and how to fix it?