API · Select

findWhere()

Emit the first object matching every requested property, then stop this branch.

Signature

findWhere(properties: Partial<T>): Exstream<T, C>

Example

const admin = await exstream(users).findWhere({ role: 'admin', active: true }).value()

Parameters

properties

Type Partial<T>Required

Shallow strict-equality matcher with the same semantics as where().

Behavior

findWhere(properties) is exactly where(properties).take(1). The match is included; empty or unmatched input emits nothing. It preserves context and releases this branch after the first match, though the range implementation can consume one later successful value while detecting completion.

Existing record errors pass through and do not end the search. Matching errors become record errors through filter().

Forms

stream.findWhere({ id: 42 })
exstream.pipeline().findWhere({ id: 42 })
exstream.findWhere({ id: 42 }, stream)
stream.through(exstream.findWhere({ id: 42 }))

where(), find(), head()