Skip to content

@gala-chain/chaincodeAPI


API > getObjectsByPartialCompositeKey

Function: getObjectsByPartialCompositeKey()

getObjectsByPartialCompositeKey\<T>(ctx, objectType, attributes, constructor): Promise\<T[]>

Type parameters

T extends ChainObject

Parameters

ctx: GalaChainContext

objectType: string

attributes: string[]

constructor: ClassConstructor\<Inferred\<T, ChainObject>>

Returns

Array of Chain Objects deserialized using the provided constructor

Description

Query Chain Objects by Partial Composite Key. Refer to class definitions for types that extend ChainObject to determine property names and order of the @ChainKey composite parts.

Non-paginated version. Use cases that expect large numbers of results should use getObjectsByPartialCompositeKeyWithPagination() instead.

Remarks

The @ChainKeys that make up the World State composite keys are ordered, and cannot be skipped when making partial composite key queries. Be advised that broad queries can lead to performance issues for large result sets.

Source

chaincode/src/utils/state.ts:135