[SERVER-288] add _id client-side, and change API such that users can get _id of an inserted document Created: 10/Sep/09  Updated: 12/Jul/16  Resolved: 27/Jan/10

Status: Closed
Project: Core Server
Component/s: Internal Client
Affects Version/s: None
Fix Version/s: 1.3.2

Type: Improvement Priority: Major - P3
Reporter: Michael Dirolf Assignee: Mathias Stearn
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Comments   
Comment by Mathias Stearn [ 27/Jan/10 ]

To avoid breaking existing code we return the _id without modifying the passed in object. If you want the the passed in object to be modified, use save()

Comment by auto [ 27/Jan/10 ]

Author:

{'login': 'RedBeard0531', 'name': 'Mathias Stearn', 'email': 'mathias@10gen.com'}

Message: db.c.insert() now generates and returns _id. SERVER-288
http://github.com/mongodb/mongo/commit/0048e481c5974e1122da678e98318419e65ea8d4

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