[DOCS-15400] Deprecated shell methods in rename replica set doc Created: 08/Jun/22  Updated: 13/Nov/23  Due: 17/Jan/23  Resolved: 17/Jan/23

Status: Closed
Project: Documentation
Component/s: mongosh, Server
Affects Version/s: 5.0.8
Fix Version/s: 5.0.0, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113

Type: Improvement Priority: Major - P3
Reporter: Shane Smith Assignee: Joseph Dougherty
Resolution: Fixed Votes: 0
Labels: Onboarding
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

sample environment:
MongoDB Server 5.0.8
mongodb-mongosh-1.4.2-1.el8.x86_64


Attachments: PNG File Screen Shot 2023-01-17 at 2.19.55 PM.png    
Participants:
Days since reply: 1 year, 3 weeks, 1 day ago
Epic Link: DOCSP-11701

 Description   

Step 2d in the below article to rename an existing unsharded replica set advises to use deprecated methods save() and remove().  The former has been fully deprecated from the mongosh binary.

https://www.mongodb.com/docs/manual/tutorial/rename-unsharded-replica-set/?force_isolation=true

If you execute these steps within a mongosh session, the save() command fails with the below error "save is not a function"

Enterprise test> db.getSiblingDB("local").system.replset.save(doc) TypeError: db.getSibling ... eplset.save is not a function

 

The remove() method still executes successfully from mongosh, but emits the below deprecation warning.

Enterprise test> db.getSiblingDB("local").system.replset.remove({_id: oldId}) 
DeprecationWarning: Collection.remove() is deprecated. Use deleteOne, deleteMany, findOneAndDelete, or bulkWrite.

 

My recommendation is to replace the above with the insertOne(doc) and deleteOne({_id: oldId}) shell methods for this step in the doc.

 

 

 

 

 



 Comments   
Comment by Joseph Dougherty [ 17/Jan/23 ]

This issue has been resolved. See screenshot.

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