Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Express Route
- app.post("/notes/new", function(req, res) {
- if(req.session.user && req.session.pass) {
- collection.insert({
- username: req.session.user,
- password: req.session.pass,
- },{ $push: {
- notes: [
- {
- id: uuidV4(),
- title: req.body.title,
- content: req.body.content
- }
- ]
- }
- }, function(err) {
- if(err) {
- console.log(err);
- }
- });
- }
- });
Add Comment
Please, Sign In to add comment