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

update documention wrong

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • None
    • manual, Server
    • None
    • mongo 6, maybe earlier

    Description

      at https://www.mongodb.com/docs/manual/reference/method/db.collection.update/

      where it mentions

      For example, the following update sets the upsert option to true:
       

      db.books.update(
      { item: "ZZZ135" }

      , // Query parameter

      { // Replacement document| |item: "ZZZ135",| |stock: 5,| |tags: [ "database" ]| |}

      ,

      { upsert: true }

      // Options

       

       

       

      does not work

      db.testdoc.update({person : "john2"}, {person : "john2", color: "blue", pencils : 21}} , {upsert: true });

       

      does work
      db.testdoc.update({person : "john2"}, {$set :

      color: Color value is invalid

      } , {upsert: true });

      Attachments

        Activity

          People

            jason.price@mongodb.com Jason Price
            m@menprojects.com Ma__rk Niel__sen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              41 weeks, 4 days ago