The name of the collection isfoo
I would like to change it topost
At the same time, willurl
Change tosite
Since there are many such document in the collection, I don’t know how to update them in batches. is there any way?
{ '_id': ObjectId() 'url': '' }
Collection changed its name.
db.foo.rename('post');
Field name change
db.post.update({$rename:{url:'site'}});