I can not rename a collection in mongoDB. I can see that it exists and can write and read data from it. I have attempted the following using the node mongo native driver.
db.collection("mycollection").renameCollection("mynewcollection");
error: TypeError: Object #<Collection> has no method 'renameCollection'
and
db['mycollection'].renameCollection("mynewcollection");
Cannot call method 'renameCollection' of undefined
performing the following in the same place returns all docs as expected
db.collection("mycollection").find({}).toArray(function(err, docs){
console.log(docs);
});