[DOCS-7287] Comment on: "manual/reference/method/db.collection.insertOne.txt" Created: 27/Feb/16  Updated: 03/Nov/17  Resolved: 30/Mar/16

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: 01112017-cleanup

Type: Bug Priority: Major - P3
Reporter: Docs Collector User (Inactive) Assignee: Unassigned
Resolution: Done Votes: 0
Labels: collector-298ba4e7
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Location: https://docs.mongodb.org/manual/reference/method/db.collection.insertOne/#db.collection.insertOne
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0
Referrer: https://docs.mongodb.org/manual/core/write-operations-introduction/
Screen Resolution: 1920 x 1080
repo: docs
source: reference/method/db.collection.insertOne


Participants:
Days since reply: 7 years, 46 weeks ago

 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.



 Comments   
Comment by Githook User [ 30/Mar/16 ]

Author:

{u'username': u'kay-kim', u'name': u'kay', u'email': u'kay.kim@10gen.com'}

Message: DOCS-7287 fix insertOne examples
Branch: master
https://github.com/mongodb/docs/commit/4f208bbc43e7cd13ffa90247a6af86b34fc0a997

Generated at Thu Feb 08 07:53:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.