loopbackio / loopbackio/loopback-next

Unable to include nested object properties in fields and in where condition in lb4

Offen
#5,244 15 Kommentare 2 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@agnes512 arbeitet bereits daran.

Seit 23.6.2020.

feature major Repository
Vorherrschende Sprache
TypeScript
Sterne
5.1k
Forks
1.1k
Ø Merge
2 T. 21 Std.
Gemergte PRs (30 T.)
27

Beschreibung

## Steps to reproduce

1. Create an entity with nested model.
Ex : Employee :
```
{
empNo: string,
empName: string,
deptId: string,
location: Location{ address1: string, address2:string, locality:string}
}
```

```ts
this.employeeRepository.find({
fields: {empName: true, departmentId: true, 'location.locality' : true},
where: {'location.locality': {regexp: pattern}}
});
```
## Current Behavior

Not accepting nested object properties to include in select fields or in where condition

## Expected Behavior

I should be able to include nested object properties in where or in fields to select ..

## Link to reproduction sandbox

not available

## Additional information

node -e 'console.log(process.platform, process.arch, process.versions.node)'
win32 x64 12.13.0

npm ls --prod --depth 0 | grep loopback

+-- @loopback/boot@2.1.0
+-- @loopback/context@3.5.0
+-- @loopback/core@2.4.0
+-- @loopback/openapi-v3@3.2.0
+-- @loopback/repository@2.2.0
+-- @loopback/rest@3.3.0
+-- @loopback/rest-crud@0.8.0
+-- @loopback/rest-explorer@2.1.0
+-- @loopback/service-proxy@2.1.0
+-- loopback-connector-mongodb@4.2.0
`-- tslib@1.11.1

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.