loopbackio / loopbackio/loopback-next

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

Open
#5,244 15 comments 2 reactions 1 assignee Claimed by @agnes512 View on GitHub
feature major Repository
Dominant language
TypeScript
Stars
5.1k
Forks
1.1k
Avg merge
2d 21h
Merged PRs (30d)
27

Description

## 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.