Skip to content

Is there possible to rename backuped collection name ? #37

@RGKrish183

Description

@RGKrish183

Hi,

its working good, but i need to rename collection name once back completed, becase i have restoring same data into different table based on using cron job.

let fmdate = new Date("11 May 2019 00:00:01 UTC");
let todate = new Date("11 May 2019 23:59:59 UTC");
backup({
  uri: "mongodb://demoroot:demopass@localhost:27017/dbDemo",
  root: `${__dirname}/bkp/`,
  parser: "bson", //use only bson to get same mongo format
  collections: ["tblBook"],
  callback: (err, data)=>{
    console.log(err);
    console.log(this)
    console.log(data);
  },
  query: {
    publisedDate: {
      $gte: fmdate,
      $lt: todate
    }
  }
});

Gopal R.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions