GithubHelp home page GithubHelp logo

Comments (12)

Arjun-Shinojiya avatar Arjun-Shinojiya commented on August 30, 2024

Same question I have. @wishedy please check my issue.I described everything about it.

from mongoose-paginate-v2.

wishedy avatar wishedy commented on August 30, 2024

Same question I have. @wishedy please check my issue.I described everything about it.

hi,where can i find

from mongoose-paginate-v2.

Arjun-Shinojiya avatar Arjun-Shinojiya commented on August 30, 2024

@wishedy #16

from mongoose-paginate-v2.

aravindnc avatar aravindnc commented on August 30, 2024

@wishedy Here is an example,

var query = {
				title: { 
					$in : [/Book/i]
				}
		};
		
		var options = {
			sort: { _id: 1},
			populate: {
				path: 'author',
				match: {
					name: 'Arthur Conan Doyle'
				}
			},
			collation: {
				locale: 'en',
				strength: 2
			}
		};
		
      return Book.paginate({}, options ).then((result) => {
});

from mongoose-paginate-v2.

aravindnc avatar aravindnc commented on August 30, 2024

You can follow this for using populate,
https://mongoosejs.com/docs/populate.html

from mongoose-paginate-v2.

wishedy avatar wishedy commented on August 30, 2024

Thanks for your advice. Because of the time difference, I am at 11 o 'clock at midnight. When I turn on the computer tomorrow, I will try. Thank you again, and the plug-in you provided, this problem has been bothering me.

from mongoose-paginate-v2.

aravindnc avatar aravindnc commented on August 30, 2024

@wishedy Thanks for using this. Feel free to open issues if you see anything.
Regarding populate, you just have to pass the populate object after understanding https://mongoosejs.com/docs/populate.html

Have a nice sleep.

from mongoose-paginate-v2.

aravindnc avatar aravindnc commented on August 30, 2024

@wishedy Hope you got it resolved.
Please reopen this thread if you have any questions.

from mongoose-paginate-v2.

Leeiio avatar Leeiio commented on August 30, 2024

@aravindnc
[populate] {Array | Object | String} - Paths which should be populated with other documents.

How can i use two populate actions?

from mongoose-paginate-v2.

aravindnc avatar aravindnc commented on August 30, 2024

@Leeiio You can pass populate object as an array. Below is an example,

let populateObj = [{
    path: 'user',
    model: 'User'
}, {
    path: 'role',
    model: 'Role'
}]

from mongoose-paginate-v2.

Leeiio avatar Leeiio commented on August 30, 2024

@aravindnc Thanks, but i can not find this usage in mongoose doc. https://mongoosejs.com/docs/api.html#query_Query-populate

from mongoose-paginate-v2.

aravindnc avatar aravindnc commented on August 30, 2024

@Leeiio Please check https://mongoosejs.com/docs/populate.html

from mongoose-paginate-v2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.