[DOCS-1695] Drop duplicates in the tutorial Created: 10/Jul/13  Updated: 11/Jul/13  Resolved: 11/Jul/13

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

Type: Improvement Priority: Major - P3
Reporter: Blake Gardner Assignee: Sam Kleinman (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 10 years, 31 weeks, 6 days ago

 Description   

The example code in the quick start tutorial for indexing and dropping duplicates does not work.

http://docs.mongodb.org/manual/tutorial/create-a-unique-index/

Change:
db.collection.ensureIndex(

{ a: 1 }

,

{ dropDups: true }

)

To:
db.collection.ensureIndex(

{ a: 1 }

,

{ unique: true, dropDups: true }

)

The working code is already in the documentation:

http://docs.mongodb.org/manual/core/indexes/#drop-duplicates

It's confusing because it seems implied that the duplicates will actually be dropped but they will not if you simply copy+paste the example code.



 Comments   
Comment by auto [ 11/Jul/13 ]

Author:

{u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

Message: DOCS-1695: amending example
Branch: master
https://github.com/mongodb/docs/commit/18bd3b082fbd27893615c2c1b866d9ebd841ed29

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