3.0.0 • Published 27 days ago

nestjs-paginate-mongo v3.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
27 days ago

Nestjs Paginate Mongo

A simple and fast way to paginate your mongoose query results on Nestjs

Requiements

  • mongoose >= 8.0.0

How to use

To paginate items, you just need to call the function and pass the query as parameter. Just like this :

import { Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { Model } from 'mongoose';
import { paginate } from 'nestjs-paginate-mongo';
import { Post, PostDocument } from './entities/post.entity';

@Injectable()
export class PostsService {
  constructor(
    @InjectModel(Post.name) private readonly posts: Model<PostDocument>,
  ) {}
  
  findAll() {
    return paginate(this.posts.find());
  }
}

And voila, you got your paginated data.

Contribution

  • If you have any problem about this package or a suggestion, dont hesitate to inform me by creating an issue
  • Are you a lovely developer and you think you can help by fixing a submitted issue ? Then I'll be glad to merge a PR from you 😊

Support me

Enjoying this little package ? You can support me 🙏

"Buy Me A Coffee"

3.0.0

27 days ago

2.0.3

8 months ago

1.0.9

9 months ago

2.0.0

9 months ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago