MongoDB Rename Collection
Use
Syntax:
db.collection.renameCollection(target, dropTarget)
Example:
For example, You have a collection with wrong spelling “
db.pproducts.renameCollection("products")
Output:
{ "ok" : 1 }
Use
Syntax:
db.collection.renameCollection(target, dropTarget)
Example:
For example, You have a collection with wrong spelling “
db.pproducts.renameCollection("products")
Output:
{ "ok" : 1 }