docparse-save-bill
v1.1.1
Published
Save new a docparse bill in the database with given data
Downloads
12
Readme
Docparse Save Bill
Save new a docparse bill in the database with given data
Dependency tracking by David
Usage
var saveBill = require('docparse-save-bill');
var moment = require('moment');
var mongoose = require('mongoose');
var ObjectId = mongoose.Types.ObjectId;
var data = {
supplierID: new ObjectId(),
customerID: new ObjectId(),
loginID: new ObjectId(),
hash: 'foo hash',
supplierCode: 'FGS',
billNumber: 'foo bill number',
dataType: 'pdf',
billDate: moment(),
accountNumber: 'foo account number',
textPages: ['foo page 1 text', 'bar page 2 text']
};
saveBill(queryParams, function(err, bill) {
if (err) {
inspect(err, 'error saveing bill')
return;
}
if (!bill) {
inspect('no bill found');
return cb();
}
inspect(bill.toObject(), 'found bill');
});
Installation
npm install docparse-save-bill
Example Installation
npm install docparse-save-bill mongoose moment eyespect