FindNearestOptions

public final class FindNearestOptions extends AbstractOptions


Summary

Public constructors

Creates a new, empty FindNearestOptions object.

Public methods

@NonNull FindNearestOptions
final @NonNull FindNearestOptions

Add a field containing the distance to the result.

final FindNearestOptions
withDistanceField(String distanceField)

Add a field containing the distance to the result.

final @NonNull FindNearestOptions
withLimit(long limit)

Specifies the upper bound of documents to return.

Inherited methods

From com.google.firebase.firestore.pipeline.AbstractOptions
final @NonNull FindNearestOptions
final @NonNull FindNearestOptions
with(@NonNull String key, @NonNull AbstractOptions<@NonNull ?> subSection)
final @NonNull FindNearestOptions
final @NonNull FindNearestOptions
with(@NonNull String key, boolean value)

Specify generic Boolean option

final @NonNull FindNearestOptions
with(@NonNull String key, double value)

Specify generic Double option

final @NonNull FindNearestOptions
with(@NonNull String key, @NonNull Field value)

Specify generic Field option

final @NonNull FindNearestOptions
final @NonNull FindNearestOptions
with(@NonNull String key, long value)

Specify generic Long option

final @NonNull FindNearestOptions

Specify RawOptions object

final @NonNull FindNearestOptions
with(@NonNull String key, @NonNull String value)

Specify generic String option

final @NonNull FindNearestOptions
with(@NonNull String key, @NonNull String values)

Public constructors

FindNearestOptions

public FindNearestOptions()

Creates a new, empty FindNearestOptions object.

Public methods

withDistanceField

public final @NonNull FindNearestOptions withDistanceField(@NonNull Field distanceField)

Add a field containing the distance to the result.

Parameters
@NonNull Field distanceField

The Field that will be added to the result.

Returns
@NonNull FindNearestOptions

A new FindNearestOptions with the specified distance field.

withDistanceField

public final FindNearestOptions withDistanceField(String distanceField)

Add a field containing the distance to the result.

Parameters
String distanceField

The name of the field that will be added to the result.

Returns
FindNearestOptions

A new FindNearestOptions with the specified distance field.

withLimit

public final @NonNull FindNearestOptions withLimit(long limit)

Specifies the upper bound of documents to return.

Parameters
long limit

must be a positive integer.

Returns
@NonNull FindNearestOptions

A new FindNearestOptions with the specified limit.