1 |
|
2 |
|
3 |
|
4 | const moment = require('moment');
|
5 | const mongoose = require('mongoose');
|
6 | const domain = require('../');
|
7 |
|
8 | async function main() {
|
9 | await mongoose.connect(process.env.MONGOLAB_URI);
|
10 |
|
11 | const actionRepo = new domain.repository.Action(mongoose.connection);
|
12 | const actions = await actionRepo.search({
|
13 | sort: { startDate: -1 },
|
14 | typeOf: domain.factory.actionType.AuthorizeAction,
|
15 | startFrom: moment().add(-3, 'days').toDate(),
|
16 | startThrough: moment().toDate(),
|
17 | object: {
|
18 |
|
19 | },
|
20 |
|
21 |
|
22 |
|
23 | result: {
|
24 |
|
25 | }
|
26 | });
|
27 | console.log(actions.length, 'actions found.');
|
28 |
|
29 |
|
30 | }
|
31 |
|
32 | main().then(() => {
|
33 | console.log('success!');
|
34 | }).catch((error) => {
|
35 | console.error(error);
|
36 | process.exit(1);
|
37 | });
|