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

Work with other plugins #158

Open
mtsmachado8 opened this issue Jul 16, 2019 · 1 comment
Open

Work with other plugins #158

mtsmachado8 opened this issue Jul 16, 2019 · 1 comment

Comments

@mtsmachado8
Copy link

Hi, thank you for the great plugin.
Found a issue tough.
Iam trying to use it with another plugin(mongoose-fuzzy-searching) and had no luck yet...
Here's my router's code

// -Get all users sorted by name
router.get('/', async (req, res) => {
let users_to_return;
const search_param = req.query.search;

if(search_param)
	users_to_return = await User.fuzzySearch(search_param).select('-password');
else
	users_to_return = await User.paginate({}, {...res.locals.pagination, sort: 'name', select: '-password' });

log.silly(`Users', ${JSON.stringify(users_to_return)})`);
log.silly(`Users', ${JSON.stringify(Envelope.paginated(users_to_return))}`);

res.json(Envelope.paginated(users_to_return));

});
I am trying to do something like
users_to_return = await User.paginate({}, {...res.locals.pagination, select: '-password' }).fuzzySearch(search_param);

Any ideas?

@NeoTheSecond
Copy link

i'm having this problem too, i always get TypeError: Converting circular structure to JSON

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

2 participants