New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Project fields in queries #142
Comments
|
@astetsa this is for querying based on id and name right?, i meant projection of fields in the returned result set. eg: if product_info has id,name,address,contact_details, i want the result set to have only id and name. |
So. You can implement two repositories. First is |
Yes that's the approach I'd also chose with two repositories. |
thanks got it. is it possible to have projections like its available in other spring data modules like mongo where we can pass the fields to be returned. like in 2.2: |
Yes totally possible and easier than expected. An implementation would be similar to MongoDB via an projection-expression that is mapped from a @Query(fields="Title") // comma separated list as per AWS documentation above
public List<ProductCatalog> findById(Long id); which would load only the Might be also worth to look in parallel in addressing #78. Possible workaround until then:
|
Merged & will be available in |
thanks a lot |
The annotation seems not to work properly, I'm trying to declare fields, I want to have projected but when performing a GET-Request I get the JSON-Doc with just null values. Any suggestions? |
I'm also having issues with the `@DynamoDBTable(tableName = "vcc-globalprovisioning-PrimaryTenant-v1")
}` `public interface PrimaryTenantRepository extends DynamoDBCrudRepository<PrimaryTenant, String> {
}` Calling this method returns also other fields than the enumerated ones in the |
Is it possible to project fields, could not find any documentation related to this:
I want to project only the "id" and "name" fields from this query.
The text was updated successfully, but these errors were encountered: