Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@folhomee-public/mongoose-tracker
Advanced tools
Is a mongoose plugin that automatically keeps track of when the document has been created, updated and optionally when some fields have been modified
Mongoose Tracker is a mongoose plugin that automatically keeps track of when the document has been created & updated. Rewrite from old mongoose-trackable which has not been updated for 7 years
With npm
npm install @folhomee/mongoose-tracker
With Yarn :
yarn add @folhomee/mongoose-tracker
Fields | Types | Default | Description |
---|---|---|---|
fieldsToTrack | Array[String] | none | Array that contain fields to track |
name | String | '__updates' | name of the Array that will contains fields |
limit | Number | 30 | Number of element in fieldsToTrack |
Use as you would any Mongoose plugin :
const mongoose = require('mongoose')
const mongooseTracker = require('@folhomee/mongoose-tracker')
const { Schema } = mongoose.Schema
const CarsSchema = new Schema({
tags: [String],
description: String,
price: { type: Number, default: 0 },
})
CarsSchema.plugin(mongooseTracker, {
limit: 50,
name: 'metaDescriptions',
fieldsToTrack: ['price', 'description'],
})
module.exports = mongoose.model('Cars', CarsSchema)
When create/update is successful, a History element is pushed to __updates or the named Array
Fields | Types | Description |
---|---|---|
field | String | name of key field |
changedTo | String | value of key field |
at | Date | time at modification |
Author: Folhomee. License Apache-2.0
FAQs
Is a mongoose plugin that automatically keeps track of when the document has been created, updated and optionally when some fields have been modified
The npm package @folhomee-public/mongoose-tracker receives a total of 0 weekly downloads. As such, @folhomee-public/mongoose-tracker popularity was classified as not popular.
We found that @folhomee-public/mongoose-tracker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.