No! Primate Mutation!

    mongoose-query-counter

    1.0.1 • Public • Published

    mongoose-query-counter

    Query counter for mongoosejs

    Maintainability Test Coverage

    Features

    • Query type counter: You are able to measure, the queries on your collection by type.

    Installation

    npm install mongoose-query-counter

    Usage

        var mongoose = require('mongoose')
        var Schema = mongoose.Schema
        var audit = require('mongoose-audit')
     
        var blogSchema = new Schema({
            name: String,
            title: String
        })
     
        var connection = mongoose.createConnection('mongodb://localhost/test')
     
        audit.initialize(connection, 'Blog')
        blogSchema.plugin(audit.plugin)
     
        var  = connection.model('Blog', blogSchema)
        var article = new Blog({title: 'test Title1', name: 'testname'})
     

    Results

    Every schema has a collection with the prefix Audit_. This collection collects the call numbers for every query type.

    Example record from Audit collection

        {
            "functionality" : "save",
            "counter" : 1
        }

    Install

    npm i mongoose-query-counter

    DownloadsWeekly Downloads

    0

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    9.07 kB

    Total Files

    9

    Last publish

    Collaborators

    • tudvari