[DOCS-4540] db.collection.ensureIndex() should be deprecated Created: 17/Dec/14  Updated: 16/Mar/15  Resolved: 06/Jan/15

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: mongodb-2.6, mongodb-3.0
Fix Version/s: v1.3.16, mongodb-2.6, mongodb-3.0

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

Issue Links:
Related
is related to DOCS-4539 db.collection.createIndex() should no... Closed
is related to JAVA-1097 deprecate ensureIndex() methods Closed
is related to CSHARP-736 Don't cache EnsureIndex and deprecate... Closed
Participants:
Days since reply: 9 years, 6 weeks, 1 day ago

 Description   

Official drivers have deprecated ensureIndex methods in favour of createIndex (eg JAVA-1097, CSHARP-736).

For consistency of API we should note ensureIndex() as deprecated in the mongo shell as well.



 Comments   
Comment by Githook User [ 06/Jan/15 ]

Author:

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

Message: DOCS-4540: changing examples with ensureIndex to use createIndex
Branch: master
https://github.com/mongodb/docs/commit/2ba39b55f482da4b383336e088f85544dbc5a79d

Comment by Githook User [ 06/Jan/15 ]

Author:

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

Message: DOCS-4540: migrate ensureIndex content to createIndex page
Branch: master
https://github.com/mongodb/docs/commit/649be580f87698b4c2c88cb70a9159a29d780417

Comment by Githook User [ 05/Jan/15 ]

Author:

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

Message: DOCS-4540: deprecation notice for ensureIndex
Branch: master
https://github.com/mongodb/docs/commit/6aa5544d42792852b99f2bc3b65ab4346565ec1b

Comment by Stennie Steneker (Inactive) [ 27/Dec/14 ]

When connecting to MongoDB 2.6+ (non-legacy write mode) ensureIndex() returns the same results as createIndex(): https://github.com/mongodb/mongo/blob/v2.6/src/mongo/shell/collection.js#L558

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