0.6.5-beta.1 • Published 8 years ago

meanair-model v0.6.5-beta.1

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

meanair (pronouced "MEAN-er" or "MEAN-air") is a framework for building + testing node.js apps.

meanair-model

Run it!

npm test

Quick overview

model is mostly about enforcing a consistent interface for defining defining schemas and data access agnostic of underlying persistent store.

Philosophically inspired by the (MS .net) Repository Pattern in which logic accesses pure data objects (via the Data Access Layer) without known about underlying persistance implementations.

Although this library is intended for meanair apps, it has no dependencies and could be used stand alone in any node app.

Glossary & acronyms

DA or DataAccessor classes - e.g. mongooseDA - implement a common interface for data access for a schema to a specific underlying store.

DAL or DataAccessLayer is the set of DAs for Schemas available to an app.

/lib

DataAccess

Common Interface

  getById(id, opts, cb) {}
  getByQuery(query, opts, cb) {}

  getAll(opts, cb) {}
  getManyByQuery(query, opts, cb) {}
  getManyById(ids, opts, cb) {}

  searchByRegex(term, matchOn, opts, cb) {}
  aggregate(chain, cb) {}

  updateUnset(id, names, cb) {}
  updateSet(id, fields, cb) {}
  updateSetBulk(updates, cb) {}

  create(o, cb) {}
  delete(o, cb) {}

  bulkOperation(inserts, updates, deletes, cb) {}

```

*Lots to say about why this interface was chosen at some point.*

<!-- Updates have to explicitly set which attribute is being updated.
This is very helpful where underlying collections may be represented
with different schemas or partial schemas across multiple apps hitting
the same database.
 -->
0.6.5-beta.1

8 years ago

0.6.4

8 years ago

0.6.4-rc

8 years ago

0.6.4-alpha.1

8 years ago

0.6.4-alpha.0

8 years ago

0.6.3

8 years ago

0.6.2

8 years ago

0.6.1

8 years ago

0.6.0

8 years ago

0.5.8

9 years ago

0.5.7

9 years ago

0.5.6

9 years ago

0.5.5

9 years ago

0.5.4

9 years ago

0.5.3

9 years ago

0.5.2

9 years ago

0.5.1

9 years ago

0.5.0

9 years ago

0.4.3

9 years ago

0.4.2

9 years ago

0.4.1

9 years ago

0.4.0

9 years ago