Aggregation Object Interface

interface Bo {
    query: ((id, option?) => Record);
    queryByCondition: ((condition, option?) => Record[]);
    queryByIdList: ((idList, option?) => Record[]);
}

Properties

query: ((id, option?) => Record)

Querying Aggregation Objects by Root Object ID

Type declaration

    • (id, option?): Record
    • Parameters

      • id: string

        Root object record ID.

      • Optional option: "db".Option

        Root Object Query Options

      Returns Record

Returns

Recordset

Example


import * as db from 'db';

let b = db.bo('MyBOTest');
let id = '00da000000f2scP5Bw36';
let option = {
options: {
fields: ["name", "age", "grade"],
}
};

let records = b.query(id, option);
queryByCondition: ((condition, option?) => Record[])

Querying Aggregation Objects Based on Root Object Conditions

Type declaration

    • (condition, option?): Record[]
    • Parameters

      • condition: Condition

        Root Object Matching Condition

      • Optional option: "db".Option

        Root Object Query Options

      Returns Record[]

Returns

Recordset

Example


import * as db from 'db';

let b = db.bo('MyBOTest');
let cond = {
conjunction: db.Conjunction.AND,
conditions: [
{
field: "name",
operator: db.Operator.eq,
value: "Tom",
}
]
};

let option = {
options: {
fields: ["name", "age", "grade"],
}
};

let records = b.queryByCondition(cond, option);
queryByIdList: ((idList, option?) => Record[])

Querying Aggregation Objects by Root Object ID List

Type declaration

    • (idList, option?): Record[]
    • Parameters

      • idList: string[]

        Indicates the root object ID list.

      • Optional option: "db".Option

        Root Object Query Options

      Returns Record[]

Returns

Recordset

Example


import * as db from 'db';

let b = db.bo('MyBOTest');
let ids = ['00da000000f2scP5Bw36','00da000000f2scP5Bw37','00da000000f2scP5Bw38'];
let option = {
options: {
fields: ["name", "age", "grade"],
}
};

let records = b.queryByIdList(ids, opt);