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.

Find options nested where

See original GitHub issue

Issue type:

[ ] question [x] bug report [ ] feature request [ ] documentation issue

Database system/driver:

[ ] cordova [ ] mongodb [ ] mssql [ ] mysql / mariadb [ ] oracle [x] postgres [ ] cockroachdb [ ] sqlite [ ] sqljs [ ] react-native [ ] expo

TypeORM version:

[x] latest [ ] @next [ ] 0.x.x (or put your version here)

Steps to reproduce or a small repository showing the problem:

According to the docs here,

Querying a column from an embedded entity should be done with respect to the hierarchy in which it was defined. Example:

userRepository.find({ where: { name: { first: "Timber", last: "Saw" } } });

For me the parameters inside of the nested object are simply missing from the query.

My example:

db.getRepostiory(device)
  .find({
    where: {
      group: { 
        id: groupId,
        account: { id: accountId }
      }
    }
  });

Here ‘accountid’ is left out of the generated query, and only ‘groupId’ is sent as a parameter.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:23
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

18reactions
imnotjamescommented, Oct 15, 2020

Nested where in find is currently working. I had tested it in another issue. I’ll be marking this one as a duplicate of that issue.

0reactions
imnotjamescommented, Oct 15, 2020

Duplicate of #2707

Read more comments on GitHub >

github_iconTop Results From Across the Web

sql - How to make complex nested where conditions with ...
I think you are mixing 2 ways of retrieving entities from TypeORM, find from the repository and the query builder.
Read more >
typeorm-nested-where
Nested relations filtering for Typeorm repositories. ... Start using typeorm-nested-where in your project by running `npm i ...
Read more >
Nested query options in select query - OData
Allowed system query options are $select and $expand, plus $filter, $search, $count, $orderby, $skip, and $top for collection-valued properties.
Read more >
Smart Nested Populate
MikroORM is capable of loading large nested structures while maintaining good performance, querying each database table only once.
Read more >
Relation queries (Concepts)
The following section shows the nested write options that are available per ... post records cannot be found: connect: [{ id: 8 },...
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