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.

Document how to query products (other entities) by custom fields

See original GitHub issue

Is your feature request related to a problem? Please describe. When implementing API extensions or other custom logic - there may come need to “find” Products or other entities by one of Custom Fields.

Let’s say I have custom field Product.customFields.visible (boolean). And I want all products where visible = true

Describe the solution you’d like Improve documentation to include example how to do this:

My example

const results = await connection.getRepository(Product)
    .createQueryBuilder('product')
    .where('product.customFieldsVisible = true')
    .getMany()

Additional context I will be happy to submit PR just need to know where it would fit the best / in which form. Or maybe its already somewhere and I just missed it?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
michaelbromleycommented, Sep 14, 2021

Hi, This is a good idea, but I don’t think there is an obviously correct place in the docs for this right now, which would be easy to locate.

It might be worth creating a “TypeORM Recipes” page which lists all the most common scenarios that might be difficult/non-obvious when developing plugins. This might fit well in the Plugins > Plugin Examples docs section.

We could include for starters:

  • Select by customField value (your example)
  • … by localeString customField
  • … by relation customField
  • Selecting translatable entities using translateDeep()
  • Creating PaginatedList responses using ListQueryBuilder
1reaction
michaelbromleycommented, Sep 15, 2021

Unfortunately not. I moved the website into a separate (private) repo. But mostly its just regular markdown which any markdown editor should render well enough.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to query ContentDocument and Custom object's fields at ...
I need to query two custom fields (Document_Type__c and Custom_Document_Description__c) from the Custom Object OS_Account_Document__c and three ...
Read more >
I generate some custom fields in contact object, now how can i ...
- To retrieve the data from custom fields below query is helpful. List<Contact> conList=[SELECT Name,Nick_Name__c,Alter_Number__c FROM Contact ...
Read more >
Expose Custom Field Data to the Frontend
Go to Customization > Lists, Records & Fields > Entity Fields > New to create a new field. Generally speaking, you will want...
Read more >
Customizing Models With Custom Fields - Vendure docs
Customizing Models with custom fields. Custom fields allow you to add your own custom data properties to many of the Vendure entities.
Read more >
What are Custom Fields? - AddSearch Documentation
Custom fields are returned with API results; allowing you to display additional information about items or products. They can also be used as...
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