NodeJS datasource agnostic model, schema and validation layer
Schemas allow you to define the name and definition of the properties that make up your data structure. You can specify whether they are required, a data type (that automatically validates) as well as additional format, length, etc validators.
var CarSchema =;
DataSources are adapters that you pass in when creating a new Model that allow you to persist different Models to different types of backends and provides a consistent API for easier implementation.
var CarDataSource = ;
Models are the main entry point to creating, fetching and validating data in your system. They hold your Schema and a DataSource adapter, as well as custom finders and additional logic to be provided to your Document classes that act as an instance of your model.
var Car = CarSchema CarDataSource;
var CarSchema =;var CarDataSource = ;var Car = CarSchema CarDataSource;// Build a Jalopyvar jalopy = Car;// Something a little nicervar porsche = Car;// Find a car from our data source (Returns a then-able Promise)Car;