Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-9701

Comment on: "primer/update.txt"

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Works as Designed
    • Icon: Trivial - P5 Trivial - P5
    • None
    • None
    • None
    • 0.25

    Description

      var updateRestaurants = function(db, callback) {
         db.collection('restaurants').updateOne(
            { "name" : "Juni" },
            {
              $set: { "cuisine": "American (New)" },
              $currentDate: { "lastModified": true }
            }, function(err, results) {
            console.log(results);
            callback();
         });
      };
      

      in this document you use

      { "name" : "Juni" }

      to update and in $set method you use

      { "cuisine": "American (New)" }

      Attachments

        Activity

          People

            allison.moore@mongodb.com Allison Reinheimer Moore
            xgen-internal-docs Docs Collector User (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              7 years, 7 weeks ago