function databaseInitialize() {
  var users = db.getCollection("users");

  // on first run, this will be null so add collection
  if (!users) {
    users = db.addCollection("users");
  }

  // add simple 1 step 'females' transform on first run
  if (!users.getTransform("females")) {
    users.addTransform("females", [{ type: 'find', value: { gender: 'f' }}]);
  }
  
  // simple parameterized document paging transform
  if (!users.getTransform("paged")) {
    users.addTransform("paged", [
      {
        type: 'offset',
        value: '[%lktxp]pageStart'
      },
      {
        type: 'limit',
        value: '[%lktxp]pageSize'
      }
    ]);
  }

  // let's keep the dynamic view from dynview example without its sort
  if (!users.getDynamicView("over 500")) {
    let ov500 = users.addDynamicView("over 500");
    ov500.applyFind({ age: { $gte : 500 } });
  }

  // for this example we will also seed data on first run
  if (users.count() === 0) {
    seedData();
  }
  
  // at this point all collections, transforms and dynamic view should exist 
  // so go ahead and run your program logic
  runProgramLogic();
}
Initialize the database with :
  - our collections (if first run and they don't exist)
  - our named collection transforms (if first run and they don't exist)
  - example data seeding
  - we will also add a  dynamic view from dynview example.