All Projects → stennettm → historical

stennettm / historical

Licence: MIT license
A Mongoose plugin that archives document diffs and manages document history.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to historical

mongoose-pii
A Mongoose plugin that lets you transparently cipher stored PII and use securely-hashed passwords
Stars: ✭ 43 (+30.3%)
Mutual labels:  mongoose, mongoose-plugin
Unix History Repo
Continuous Unix commit history from 1970 until today
Stars: ✭ 4,851 (+14600%)
Mutual labels:  history, snapshot
mongoose-slug-plugin
Slugs for Mongoose with history and i18n support (uses speakingurl by default, but you can use any slug library such as limax, slugify, mollusc, or slugme)
Stars: ✭ 21 (-36.36%)
Mutual labels:  mongoose, history
Spotify Playlist Archive
Daily snapshots of public Spotify playlists
Stars: ✭ 111 (+236.36%)
Mutual labels:  history, snapshot
mongoose-plugin-cache
The Perfect Marriage of MongoDB and Redis
Stars: ✭ 42 (+27.27%)
Mutual labels:  mongoose, mongoose-plugin
mongoose-keywords
Mongoose plugin that generates a keywords path combining other paths values
Stars: ✭ 23 (-30.3%)
Mutual labels:  mongoose, mongoose-plugin
Mongoose Patch History
Mongoose plugin that saves a history of JSON patch operations for all documents belonging to a schema in an associated 'patches' collection
Stars: ✭ 82 (+148.48%)
Mutual labels:  mongoose, history
Discord-Template-V13
An easy-to-use discord bot including database, slash commands and context menus !
Stars: ✭ 103 (+212.12%)
Mutual labels:  mongoose
chat-app-server
Back-end server for chat application built using express, moongodb & socket.io for Frontend (https://github.com/binbytes/nuxt-chat-app).
Stars: ✭ 30 (-9.09%)
Mutual labels:  mongoose
test-mongoose-inmemory
A sample project that demonstrates how to test mongoose operations through jest with an in-memory database.
Stars: ✭ 39 (+18.18%)
Mutual labels:  mongoose
TvrboReact
Dream starter project: React, Redux, React Router, Webpack
Stars: ✭ 13 (-60.61%)
Mutual labels:  mongoose
Discord.js-MongoDB-bot
Discord.js botları için Mongoose veritabanı (database) kullanım örnekleri.
Stars: ✭ 13 (-60.61%)
Mutual labels:  mongoose
pothole detection
By using this app users can report the potholes on road by clicking a photo via our app and if a pothole is detected by Machine Learning modal then it is saved to our Database from where officials can view the specifics like location,reported by and official can resolve the request.User are notified by email for every update regarding their request
Stars: ✭ 17 (-48.48%)
Mutual labels:  mongoose
graphql-rest-api-demo
A demo of what an equivalent REST API and GraphQL API look like.
Stars: ✭ 51 (+54.55%)
Mutual labels:  mongoose
xbn admin node
使用nodejs的express框架搭建的后台管理系统
Stars: ✭ 25 (-24.24%)
Mutual labels:  mongoose
Apriliya-Api
Simple Web API with user authentication
Stars: ✭ 19 (-42.42%)
Mutual labels:  mongoose
MovieGo
A Website implemented using MERN (MongoDB, ExpressJS, ReactJS and NodeJS) stack, which allows users to sign-in/register and book movie tickets online.
Stars: ✭ 26 (-21.21%)
Mutual labels:  mongoose
express-rest-api
🍺 RESTful API sample in Express, Mongoose and ES6.
Stars: ✭ 28 (-15.15%)
Mutual labels:  mongoose
mongoose-aggregate-paginate-v2
A cursor based custom aggregate pagination library for Mongoose with customizable labels.
Stars: ✭ 103 (+212.12%)
Mutual labels:  mongoose
web full stack application
show full stack technology applications : Scrapy + webservice[restful] + websocket + VueJS + MongoDB
Stars: ✭ 16 (-51.52%)
Mutual labels:  mongoose

Build Status Historical

A Mongoose plugin that archives document diffs and manages document history.

Historical requires a primary key (typically _id) to be present in your schema.

Installation

npm install historical@^2.0.0

Getting Started

Attach the plugin to your schema with any of these optional configuration parameters:

  • name: Provide a collection name. Defaults to <collection>_historicals.
  • connection: Provide a mongoose connection for the historical collection. Defaults to your schema's connection.
  • primaryKeyName: Provide your schema's primary key name. Defaults to _id.
  • primaryKeyType: Provide your schema's primary key type. Defaults to your schema's primary key field configuration.
  • ignore: An array of field names to ignore. Fields included in this list will not be stored in history.
var mongoose  = require('mongoose'),
ExampleSchema = new mongoose.Schema({
    myField: String,
    ignoredField: String,
    anotherIgnoredField: String
});

ExampleSchema.plugin(require('historical'), {
    connection: mongoose.createConnection('mongodb://localhost/example'),
    name: null,
    primaryKeyName: null,
    primaryKeyType: null,
    ignore: ['ignoredField', 'anotherIgnoredField']
});

Document #historicalDetails()

List historical documents up to the given date for a document.

myDocument.historicalDetails(new Date('2010-08-17T12:09:36'), function(e, objs){
   //the list of historical changes for my document
   console.log(objs);
});

Document #historicalRestore()

Returns a document as it was at the given date.

myDocument.historicalRestore(new Date('2010-08-17T12:09:36'), function(e, obj){
   //my document as it was in 2010
   //or null, if it either had not yet been created or was deleted before this time
   if(obj) {
      obj.save();
   }
});

Document #historicalTrim()

Creates a new historical document by flattening history up to the given date, and deletes the touched historical documents. Useful for pruning or establishing a maximum history retention period.

myDocument.historicalTrim(new Date('2010-08-17T12:09:36'), function(e, obj){
   //any history before this time has been flattened into one historical document
   //my document as it was provided
   console.log(obj);
});

Document #historicalSnapshot()

Take a complete and current snapshot of my document and store it in history. Unmodified documents only.

myDocument.historicalSnapshot(function(e, obj){
   //my document as it was provided
   console.log(obj);
});

Document #historicalClear()

Clear all history for my document and take a snapshot. Unmodified documents only.

myDocument.historicalClear(function(e, obj){
   //my document as it was provided
   console.log(obj);
});
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].