i am get data in mongodb and express return occurs without errors but I wanted to use JSON.parse in the final results of my .find see below how I'm trying to do this
app.get("/login", (req, res) => {
var credentialClient = {
expire_at: false,
__v: false,
_id: false
};
rememberMe.find({ username: "test-login" }, credentialClient, function (err, credentialInfo) {
if (err) {
res.send(err);
} else {
res.render("login.html", {
usernameClient: JSON.parse(credentialInfo)
});
}
});
});
Without JSON.parse the final rendering stays that way in my login.html
{ username: 'test-login' }
The final results appear in login.html
<p class="center-align black-text" id="preFinalCredentialClient">{{ usernameClient }}</p>
Thanks for helping me!