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

Comment on: "manual/reference/method/db.collection.insertOne.txt"

    XMLWordPrintableJSON

Details

    Description

      Hello world.
      There seems to be a minor oversight in the following example:
      db.products.insertOne(

      { _id: 10, item: "box", qty: 20 }

      );
      The operation can not return an ObjectId value.

      { "acknowledged" : true, "insertedIds" : ObjectId("562a94d381cb9f1cd6eb0e1a") }

      'insertedId' value is supposed to be 10.

      Attachments

        Activity

          People

            Unassigned Unassigned
            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, 46 weeks ago