Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no pagination #134

Open
JoseRFJuniorLLMs opened this issue Jan 30, 2018 · 0 comments
Open

no pagination #134

JoseRFJuniorLLMs opened this issue Jan 30, 2018 · 0 comments

Comments

@JoseRFJuniorLLMs
Copy link

const mongoose = require('../../database');
const mongoosePaginate = require('mongoose-paginate');//paginação
const bcrypt = require('bcryptjs');

mongoosePaginate.paginate.options = {
lean: true,
limit: 1
};

const PessoasSchema = new mongoose.Schema({
nome: {
type: String,
require: true,
},
cpf: {
type: String,
require: true,
},
//*****************************************USUARIO */
user: {
type: mongoose.Schema.Types.ObjectId,
ref: 'User',
require: true,
},

createdAt: {
type: Date,
default: Date.now,
},
},
{
usePushEach: true
},
);

PessoasSchema.plugin(mongoosePaginate);

const Pessoas = mongoose.model('Pessoas', PessoasSchema);

module.exports = Pessoas;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant