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

update documention wrong

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • Affects Version/s: None
    • Component/s: manual, Server
    • Labels:
      None
    • Environment:
      mongo 6, maybe earlier

      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 });

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

              Created:
              Updated:
              Resolved:
              1 year, 3 days ago