Needs Perl Modules

    mongoose-paged-find

    0.0.2 • Public • Published

    mongoose-page-find

    Installation

    Install node.js, mongodb, mongoose, then

    npm install mongoose-page-find

    Stability

    The current stable branch is master.

    Usage

    Read mongoose documentation here

    First setup plugin to mongoose schema.

    const mongoose = require('mongoose');
    const pageFindPlugin = require('mongoose-page-find');
    
    const userSchema = new mongoose.Schema(
        {
            firstName: String,
            lastName: String,
            email: String,
        }
    );
    
    userSchema.plugin(pageFindPlugin);
    

    Query example

    const User = mongoose.model('User', userSchema);
    
    User.pageFind(
        {
            filters: {
                firstName: 'John'
            },
            page: 1,
            limit: 30,
            sort: {
                lastName: 1
            }
        },
        (err, data) => {
            console.log(data);
        }
    )
    

    Install

    npm i mongoose-paged-find

    DownloadsWeekly Downloads

    0

    Version

    0.0.2

    License

    ISC

    Last publish

    Collaborators

    • gormatevosyan