Oracle® Backend For Firebase JavaScript Namespace SDK Reference, Release 26.1.0
    Preparing search index...
    Oracle® Backend For Firebase JavaScript Namespace SDK Reference
    Release 26.1.0

    G48197-02

    Represents a operation for a fieldvalue in a document to be applied to server.

    Index

    Constructors

    Methods

    • Compares this FieldValue with another FieldValue instance.

      Parameters

      • other: FieldValue

        Another FieldValue instance to compare.

      Returns boolean

      true if both are equal, false otherwise.

      Throws an error if the provided object is not an instance of FieldValue.

    • Creates a FieldValue instance for remove operation in a array field.

      Parameters

      • ...elements: any[]

        Multiple values that needs to be removed.

      Returns FieldValue

      FieldValue instance representing the change.

    • Creates a FieldValue instance for union operation in a array field.

      Parameters

      • ...elements: any[]

        Multiple values that needs to be applied in union.

      Returns FieldValue

      FieldValue instance representing the change.

    • Creates a FieldValue instance for delete operation of a field.

      Returns FieldValue

      FieldValue instance representing the change.

    • Creates a FieldValue instance for deleting an embedding entry in v2.

      Returns FieldValue

      FieldValue instance representing the change.

      await docRef.update({
      LEGACY_EMB: FieldValue.deleteVector()
      });
    • Creates a dense embedding payload.

      Parameters

      • values: number[]

      Returns { type: "dense"; values: number[] }

      await docRef.update({
      DENSE_EMB: FieldValue.denseVector([0.12, -0.91, 0.44])
      });
      await colRef.add({
      title: "vector doc",
      DENSE_EMB: FieldValue.denseVector([0.12, -0.91, 0.44])
      });
    • Creates a FieldValue instance for increment operation in a number field.

      Parameters

      • n: number

      Returns FieldValue

      FieldValue instance representing the change.

    • Creates a FieldValue instance for getting a server timestamp.

      Returns FieldValue

      FieldValue instance representing the change.

    • Creates a sparse embedding payload.

      Parameters

      • dimension: number
      • indices: number[]
      • values: number[]

      Returns { dimension: number; indices: number[]; type: "sparse"; values: number[] }

      await docRef.update({
      SPARSE_EMB: FieldValue.sparseVector(1000, [3, 40, 777], [0.5, 0.8, 0.33])
      });
      await colRef.add({
      title: "sparse vector doc",
      SPARSE_EMB: FieldValue.sparseVector(1000, [3, 40, 777], [0.5, 0.8, 0.33])
      });