Jehus kleine Welt

  • Archiv
  • RSS
  • Ask me anything

mongoose: Document Update (RESTful)

Für die (Gedächtnis-)Ablage:

// Notes Update (PUT)
app.put('/notes/:id.json', function(req, res) {
    Note.update(
        { _id: req.params.id }, // find updatable document by _id
        {
            text: req.body.text,
            starts_at: req.body.starts_at,
            due_to: req.body.due_to,
            sticky: req.body.sticky
        },
        function(err) {
            if(err) throw(err);
            res.send({success: true});
        }
    );
});
    • #mongoose
    • #nodejs
  • Vor 1 Jahr
  • 1
  • Comments
  • Permalink
  • Share
    Tweet

1 Notes/ Hide

  1. von jehu99 gepostet

Neueste Kommentare

Blog-Kommentare powered by Disqus
← Vorige Seite • Weiter →

Über

Avatar was so täglich an- und abfällt

Seiten

  • Impressum

Twitter

loading tweets…

  • RSS
  • Beliebig
  • Archiv
  • Ask me anything
  • Mobil

Effector Theme by Carlo Franco.

Powered by Tumblr