An open API service indexing awesome lists of open source software.

https://github.com/elsehow/sequelize-getsince

A simple wrapper for Sequelize that gets all entries of type `sequelizeModel` since some time `timeInPast`
https://github.com/elsehow/sequelize-getsince

Last synced: about 1 year ago
JSON representation

A simple wrapper for Sequelize that gets all entries of type `sequelizeModel` since some time `timeInPast`

Awesome Lists containing this project

README

          

## sequelize-getEntriesSince

A simple wrapper for Sequelize that gets all entries of type `sequelizeModel` created since some time `timeInPast`

## getEntriesSince(timeInPast, sequelizeModel, successCb, errorCb)

## example usage

```
getSince = require('getSince')

// our db
sequelize_db = Sequelize(...)
SomeSequelizeModel = sequelize_db.define(...)

timeInPast = moment().subtract(24, 'hours')

getSince(
timeInPast
, SomeSequelizeModel
// success cb
, function handleRecentReadings(data) {
console.log('got it!', data)
sequelize_db.close()
}
// error cb
, function(err) {
console.log('error!', err)
sequelize_db.close()
})
```