@servicetitan/acquisition-functions
Synopsis
This repo contains Marketing Acquisition properties & filters converters for MongoDB Atlas Functions
Usage in functions
Example:
const { configureProcessor } = require('@servicetitan/acquisition-functions');
const { filterFetcher } = configureProcessor({
workers: 10,
mongoDb: mongoDbConnectionToDb,
fetchProperties: (zip) => mongoDbConnectionToDb.collection('properties').find({zipcode: zip}, {_id: 0}),
});
exports = async () => {
return filterFetcher.start('000000-999999');
};
Run tests
Locally:
docker-compose up -d mongo
npm run test
In Docker:
docker-compose up --from-exit-code=tests