Copy Specific Columns from DB 1 To DB 2 on MongoDB I have Two Instance of Node JS server which is handled By NGINX. First server is connect with MongoDB First Server i.e 


  mongoose.connect('mongodb://127.0.0.1/db_primary', { useMongoClient: true });


While Second Node Js Server is Connect with MongoDB Second Serer i.e 


  mongoose.connect('mongodb://127.0.0.1/db_secondary', { useMongoClient: true });


Actually, I have to Do some Heavy Calculations on DB and that the main reason I will divide my DB into Two Pieces.

Initially When I have One Server then if the backend is busy with calculations (Millions of Entries) at that time Server is completely freeze. So by the Separation There is now no freezing point of server.

My Question is How I can Copy the selected Columns on The entire Table form DB 1 And paste it to DB 2 with only Selected Columns.

Example:Database 1 


{
    _id: ObjectID(54815dfsfsd1f564168ad51a5s),
    a: 123,
    b: 768,
    c: 89.67,
    d: 8976,
    e: 45
  }..........upto 10 million entries


Now I want to Copy Only Column c &amp; e from Database 1 to Database 2.

Expected Result: 
{
        _id: ObjectID(54815dfsfsd1f564168ad51a5s),
        c: 89.67,
        e: 45
}..........upto 10 million entries


And all these things are done by CronJob of Nodejs. I mean Not a manual task.

I am Newbie on MongoDB. Any help is appreciated.
You can do projection with query. So, db.collection.find({},{c:1,e:1}) and then insert that to second DB.

Inside the one DB you can do it with use of aggregation with project and out stages.

Have you consider to use replica set and secondary read?