Created
November 1, 2017 16:25
-
-
Save ZaninAndrea/45ac21982e4cd09f43e9ec16d50fa0ef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// base route | |
app.put("/:user", function (request, response) { | |
collection.updateOne({ user : request.params.user }, | |
{$set:{ ...request.body, user : request.params.user }}, | |
function (err, r) { | |
if (err){ | |
response.send("An error occured") | |
}else{ | |
response.send("All well") | |
} | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
s/occured/occurred ?