Question: I have a problem with my code in C++ and need some help. There are some related questions but I couldn't really understand the answers.
I have a text file ('parameters.dat' in the example below) that I want to read in with my code written in C++. The file includes different types of variables: Boolean, doubles and integers as well as some comments which I want to skip when reading.
My file looks something like that: 

```
150    // this is an integer    
4e-1   // this is a double    
1.05   // another double   
0      // this is a logical (Boolean) variable: 0 is false and 1 is true

```

A simple version of the code that I use is

```
int N;
double var_1, var_2;
bool inital;

ifstream read_parameters;
read_parameters.open("parameters.dat");
read_parameters >> N >> var_1 >> var_2 >> initial;
read_parameters.close();

```

The comments seem to ruin everything and even without them there seem to be some problems with reading the logical variables correctly. The file that I try to read is made by me, so I can substitute the '//' above with something else if necessary. Does anyone have any advice?

Thanks in advance!

Answer: 
From the mongodb documentation (<https://docs.mongodb.com/manual/reference/command/renameCollection/>)

renameCollection has different performance implications depending on the target namespace.

**If the target database is the same as the source database**, renameCollection simply changes the namespace. **This is a quick operation.**

If the target database differs from the source database, renameCollection copies all documents from the source collection to the target collection. Depending on the size of the collection, this may take longer to complete. Other operations which require exclusive access to the affected databases will be blocked until the rename completes. See What locks are taken by some common client operations? for operations which require exclusive access to all databases.

Note that:
\* renameCollection is not compatible with sharded collections.
\* renameCollection fails if target is the name of an existing collection and you do not specify dropTarget: true.
I have renamed multiple collections with around 500M documents. It completes in ~0 time. 
This is true for MongoDB 3.2 and 3.4, and I would guess also for older versions.