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.

Parameters documentation

See original GitHub issue

The find(entity, params) only shows the basics. How to use all the parameters here? Can you provide more examples?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12

github_iconTop GitHub Comments

2reactions
Rendxncommented, Nov 2, 2020

Actually, it works fine using the $strapi.find('categories', { _sort: 'created_at:desc }) and the same applies for any other Strapi parameter (_limit, _sort, _start, etc) If you wanna use categories, you should take a look at the Strapi guide, where they use Restaurants and Categories, then when you fetch your articles you could do: $strapi.find('articles', { category.name: yourCategoryName }). Also, if you are doing $strapi.find('categories', { _sort: 'created_at:desc }), this will get the articles related to each category with them unless you set them to private in your model json.

Edit: If you wanna get all the articles for a given set of categories, you need to use the 1st Method shown here, in which they pass an array $strapi.find('products', [['categories.name', 'women'], ['categories.name', 'men']]). Or if you want to get the products that have both men and women as their category, you need to do the 2nd Method shown there await $strapi.find('products', { 'categories.name': ['women', 'men'] })

0reactions
mrsuarezgcommented, May 13, 2022

Por si ha alguien le sirve yo utilize qs, pero cometía el error de pasarlo: const academy = await this.$strapi.find(‘collection-example’, { queryCollection }) Cuando la forma correcta era usar el cliente http de Strapi puesto que el módulo de Nuxt no soporta nativamente la versión 4 aunque lo diga. Lo siguiente funcionó para mi: const results = await this.$strapi.$http.$get(‘collection-example’, { searchParams: queryCollection })

Read more comments on GitHub >

github_iconTop Results From Across the Web

Describing Parameters - Swagger
In OpenAPI 3.0, parameters are defined in the parameters section of an operation or path. To describe a parameter, you specify its name...
Read more >
Step 3: Parameters (API reference tutorial) | Documenting APIs
Step 3: Parameters (API reference tutorial) · Examples of parameters · Several types of parameters · What to note in parameter documentation.
Read more >
Parameters Document - IBM
A Parameters document contains details of each Property element defined in the specification file. The details are returned in the form of configuration ......
Read more >
Parameters - Snowflake Documentation
Snowflake provides the SHOW PARAMETERS command, which displays a list of the parameters, along with the current and default values for each parameter....
Read more >
Defining Document Parameters
... the parameters that define the kinds of documents to be managed through the application. Managed Documents provides both base and custom parameter...
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