docparse-default-upload

instatiate a default upload mongoose model in memory

Docparse Default Uploads

Create default upload mongoose model in memory for use in docparse tests

Dependency tracking by David

Usage

Default object

var inspect = require('eyespect').inspector()
var createDefaultUpload = require('docparse-default-upload')
createDefaultUpload(function(errupload) {
  if (err) {
    inspect(err, 'error creating upload')
    return;
  }
  inspect(upload.toObject(), 'created upload');
});

With custom data

var billID = new ObjectId();
var data = {
  billNumber: 'bar bill number',
  textPages: ['bar page 1 text', 'bar page 2 text'],
  hash: 'bar hash',
  supplier: new ObjectId(),
  status: 'bar status',
  supplierCode: 'POS',
  billIDs: [billID]
};
var createDefaultUpload = require('docparse-default-upload')
createDefaultUpload(data, function(errupload) {
  if (err) {
    inspect(err, 'error creating upload')
    return;
  }
  inspect(upload.toObject(), 'default upload');
});

npm install docparse-default-upload