question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to find like mongoose?

See original GitHub issue

Question about Keystone

Anyway to make a find like in mongoose?

I googled to see likes a way to find the list results:


var keystone = require('keystone'),
    Post = keystone.list('Post');

Post.model.find()
    .where('state', 'published')
    .populate('author')
    .sort('-publishedAt')
    .limit(5)
    .exec(function(err, posts) {
        // do something with posts
    });

I tried the same way but list method not found. Any way to query the results?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Vultrazcommented, Dec 23, 2019

That is the old keystone 4 method for querying. Keystone 4 was moved to the keystone-classic repo. Keystone 5 and later use GraphQL.

0reactions
williamhqscommented, Jan 2, 2020

@gautamsi Thanks for the tips. Figured it out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How I can use "LIKE" operator on mongoose?
I have a problem when i query using mongoose.I coding follow this Mongoose.js: Find user by username LIKE value. But it return blank....
Read more >
How to query documents with "like" statement in Mongoose
In Mongoose, you can use the $regex operator to perform a search query in MongoDB, similar to SQL LIKE statement.
Read more >
mongoose Like Operator
The LIKE operator is common is SQL. It is a very useful operator when we need to filter the data according to some...
Read more >
Mongoose v6.8.1: Queries
const Person = mongoose.model('Person', yourSchema); // find each person with a last name matching 'Ghost', selecting the `name` and `occupation` fields Person.
Read more >
Find with LIKE mongoose
const escapeStringRegexp = require('escape-string-regexp'); const User = mongoose.model('User', mongoose.Schema({ email: String })); await User.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found