Options
All
  • Public
  • Public/Protected
  • All
Menu

geofirestore-core

Index

Functions

  • Encodes a Firestore Document to be added as a GeoDocument.

    Parameters

    • documentData: DocumentData

      The document being set.

    • Optional customKey: string

      The key of the document to use as the location. Otherwise we default to coordinates.

    Returns GeoDocumentData

    The document encoded as GeoDocument object.

  • Encodes a Firestore Document to be set as a GeoDocument.

    Parameters

    • documentData: DocumentData

      A map of the fields and values for the document.

    • Optional options: SetOptions

      An object to configure the set behavior. Includes custom key for location in document.

    Returns GeoDocumentData | DocumentData

    The document encoded as GeoDocument object.

  • Encodes a Firestore Document to be updated as a GeoDocument.

    Parameters

    • documentData: UpdateData

      The document being updated.

    • Optional customKey: string

      The key of the document to use as the location. Otherwise we default to coordinates.

    Returns UpdateData

    The document encoded as GeoDocument object.

  • Encodes a document with a GeoPoint as a GeoDocument.

    Parameters

    • geopoint: GeoPoint | GeoPoint

      The location as a Firestore GeoPoint.

    • documentData: DocumentData

      Document to encode.

    Returns GeoDocumentData

    The document encoded as GeoDocument object.

  • Executes a query and returns the result(s) as a GeoQuerySnapshot.

    WEB CLIENT ONLY Note: By default, get() attempts to provide up-to-date data when possible by waiting for data from the server, but it may return cached data or fail if you are offline and the server cannot be reached. This behavior can be altered via the GetOptions parameter.

    Parameters

    Returns Promise<GeoQuerySnapshot>

  • Executes a query and returns the result(s) as a GeoQuerySnapshot.

    WEB CLIENT ONLY Note: By default, get() attempts to provide up-to-date data when possible by waiting for data from the server, but it may return cached data or fail if you are offline and the server cannot be reached. This behavior can be altered via the GetOptions parameter.

    Parameters

    Returns (onNext: (snapshot: GeoQuerySnapshot) => void, onError?: (error: Error) => void) => () => void

      • (onNext: (snapshot: GeoQuerySnapshot) => void, onError?: (error: Error) => void): () => void
      • Executes a query and returns the result(s) as a GeoQuerySnapshot.

        WEB CLIENT ONLY Note: By default, get() attempts to provide up-to-date data when possible by waiting for data from the server, but it may return cached data or fail if you are offline and the server cannot be reached. This behavior can be altered via the GetOptions parameter.

        Parameters

        Returns () => void

          • (): void
          • Returns void

  • validateGeoDocument(documentData: GeoDocumentData, flag?: boolean): boolean
  • Validates the inputted GeoDocument object and throws an error, or returns boolean, if it is invalid.

    Parameters

    • documentData: GeoDocumentData

      The GeoDocument object to be validated.

    • flag: boolean = false

      Tells function to send up boolean if valid instead of throwing an error.

    Returns boolean

    Flag if data is valid

  • validateLimit(limit: number, flag?: boolean): boolean
  • Validates the inputted limit and throws an error, or returns boolean, if it is invalid.

    Parameters

    • limit: number

      The limit to be applied by GeoQuery.limit()

    • flag: boolean = false

      Tells function to send up boolean if valid instead of throwing an error.

    Returns boolean

  • validateLocation(location: GeoPoint | GeoPoint, flag?: boolean): boolean
  • Validates a GeoPoint object and returns a boolean if valid, or throws an error if invalid.

    Parameters

    • location: GeoPoint | GeoPoint

      The Firestore GeoPoint to be verified.

    • flag: boolean = false

      Tells function to send up boolean if not valid instead of throwing an error.

    Returns boolean

  • validateQueryCriteria(newQueryCriteria: QueryCriteria, requireCenterAndRadius?: boolean): void
  • Validates the inputted query criteria and throws an error if it is invalid.

    Parameters

    • newQueryCriteria: QueryCriteria

      The criteria which specifies the query's center and/or radius.

    • requireCenterAndRadius: boolean = false

      The criteria which center and radius required.

    Returns void

Generated using TypeDoc