The jump()
method is a convenient interface to inner_join()
, for times when the left-hand query's
contribution to the output is not required.
For any queries l
, r
,
you can call l
.jump(
r
,
condition
)
provided that:
condition
is an abstract_mapper<bool>
(in practice it will be a predicate
).
l
and r
's value
mappers will both be visible
to condition
.
l
.jump(
r
,
condition
)
returns a query
with the following characteristics:
r
's.
r
's.
l
's outputs, and replace each item
lo
by all of r
's
outputs ro
such that condition
evaluates to true
using
the values lo
and ro
.
l
.jump(
r
,
condition
)
is interchangeable with l
.inner_join(
r
,
condition
).select(*
r
)
, which has exactly the same characteristics.
const query<movie> movies_being_screened = screens.jump(movies, screens->current_movie_id == movies->id);