0

I'm using nano db library (also try this with cloudant ant library) for node js

I have this sample code :

exports.insert = function (db_name, data, callback) {
    var db_name=db_name;   if(!db){   db = nano.use(db_name);   }   console.log(`try to make bulk copy to Couchdb`);   db.bulk(data, function (err, body) {
    if (!err) {
      console.log(`data in db ${db_name} inserted successfully`);
      return callback(null, body);

    }
    console.log(`err ouccre ${err}`);
    return callback(err);

  }); }

The "data" variable is an object that contain the 'docs' property and 'docs' contain array.

I'ts always do the bulk work and put the docs array into my cloudnat db , but

Often doesn't return any callback (err / success) to my node js process

and it stuck...

Any suggestion?

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
Yossi
  • 337
  • 1
  • 2
  • 10

0 Answers0