@parameter1/base-cms-section-query-generator

4.74.0 • Public • Published

BaseCMS section query generator

This utility can be used to regenerate the BaseCMS content sectionQuery field.

Usage

To use, import the package and await the exported function, supplying the relevant tenant key and an active (connected) MongoDB client.

Note: You must use the @parameter1/base-cms-db MongoDB client/factory.

const buildFn = require('@parameter1/base-cms-section-query-generator');
const { createMongoClient } = require('@parameter1/base-cms-db');

const { NODE_ENV, MONGO_DSN } = process.env;
const appname = `myapp v1.0 (env: ${NODE_ENV})`;

const client = createMongoClient(MONGO_DSN, { appname });
await client.connect();

await buildFn({ tenant: 'my_tenant_key', client });

await client.close();

Arguments

Option Description Default value
tenant (Required) A BaseCMS tenant key
client (Required) A connected MongoDB client
context (Optional) Additional context for the BaseDB instance {}
logger (Optional) A function to log debug information to console.log
maxDate (Option) A Date indicating how far in the future to check for schedules 2038-01-01
createIndexes (Optional) A Boolean indicating if indexes should be built false

Readme

Keywords

none

Package Sidebar

Install

npm i @parameter1/base-cms-section-query-generator

Weekly Downloads

3

Version

4.74.0

License

MIT

Unpacked Size

6.75 kB

Total Files

4

Last publish

Collaborators

  • b77mills
  • brandonbk
  • zarathustra323
  • solocommand