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

  // on first run, this will be null so add collection
  if (!users) {
    users = db.addCollection("users");
  }
  
  // on first run, add the dynamic view to the collection
  if (!users.getDynamicView("over 500")) {
    // add empty dynamic view
    let ov500 = users.addDynamicView("over 500");
    
    // apply a find filter, you can do add as many find filters as 
    // you want and these filters will be saved along with the database
    // and its collections.
    ov500.applyFind({ age: { $gte : 500 } });

    // apply a sort (if you need to)
    ov500.applySimpleSort('age', true);
  }

  // if we needed 'where' filters our persisted database, we would need to
  // reapply everytime. (commented out since we don't want to use it in this example)
  // ov500.applyWhere(function(obj) { return obj.gender === 'm'; });
  
  // for this example we will also seed data on first run
  if (users.count() === 0) {
    seedData();
  }
  
  // at this point all collections 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 dynamic view (if first run and they don't exist)
  - example data seeding

 Other applications might need to also
  - reapply and 'where' filters in any dynamicviews
  - you might initiatialize some collection transforms
  - which can be used with or without dynamic views