System Object Operation Interface

Hierarchy

  • Setup

Properties

batchInsert: ((records) => string[])

Type declaration

    • (records): string[]
    • Inserting Records in Batches

      Parameters

      Returns string[]

      ID set of records that are successfully inserted.

batchUpdate: ((records) => string[])

Type declaration

    • (records): string[]
    • Batch Update Records

      Parameters

      Returns string[]

      Updated record ID set

count: ((condition?) => number)

Type declaration

    • (condition?): number
    • Count the number of records that meet the condition.

      Parameters

      • Optional condition: Condition

        Matching condition

      Returns number

      Number of records that meet the conditions

      Example


      import * as db from 'db';

      let s = db.setup('setup_object');
      let cond = {
      conjunction: db.Conjunction.AND,
      conditions: [
      {
      field: "name",
      "operator": db.Operator.eq,
      "value": 'setup_name'
      }
      ]
      }
      let num = s.count(cond);
delete: ((id) => number)

Type declaration

    • (id): number
    • Deletes records by ID.

      Parameters

      • id: string

        Record ID.

      Returns number

      Number of Affected Records

deleteByCondition: ((condition?) => number)

Type declaration

    • (condition?): number
    • A maximum of 5000 records can be deleted based on conditions.

      Parameters

      Returns number

insert: ((record) => string)

Type declaration

    • (record): string
    • Create a record

      Parameters

      Returns string

      Specifies the ID of a new record.

query: ((id) => Record)

Type declaration

    • (id): Record
    • Querying Records by ID

      Parameters

      • id: string

        Record ID.

      Returns Record

      Recording

queryByCondition: ((condition?, option?, relation?) => Record[])

Type declaration

    • (condition?, option?, relation?): Record[]
    • The number of records to be returned can be limited. The skip value is used to specify the number of records to be returned. The limit value is used to specify the number of records to be returned.

      If skip and limit are not specified, the default values are skip=0 and limit=5000, indicating that the first 5000 records in the result set are returned. The maximum limit can be set to 10000, indicating that the query interface can return only the first 10000 records in the query result set.

      Parameters

      • Optional condition: Condition

        Matching condition

      • Optional option: "db".Option

        Query Options

      • Optional relation: Relation

        Parent-son relationship

      Returns Record[]

      Recordset

update: ((id, record) => number)

Type declaration

    • (id, record): number
    • Updates records by ID.

      Parameters

      • id: string

        Record ID.

      • record: Record

        Update Content

      Returns number

      Number of Affected Records

updateByCondition: ((record, condition?) => number)

Type declaration

    • (record, condition?): number
    • Records are updated based on conditions. A maximum of 5000 records can be updated.

      Parameters

      • record: Record

        What needs to be updated

      • Optional condition: Condition

        Matching condition

      Returns number