Skip to content

Is valid data for table

Validate table data

Test data valid or not using global object 'g'.

1
2
3
4
5
6
7
8
9
await g.sys.system.isValidDataForTable({
    instance: "INSTANCE_NAME",
    database: "DATABASE_NAME",
    collection: "COLLECTION_NAME",
    data: {
        "field": "fieldValue",
        "field": "fieldValue"
    }
});
await g.sys.system.isValidDataForTable({
    instance: "mongoDB",
    database: "db_inventory",
    collection: "tbl_customers",
    data: {
        "customer_id": 1,
        "first_name": "Bob",
        "last_name": "Lin",
        "last_update": "2006-02-14T23:04:33.000Z",
        "pincode": 382330,
        "isActive": 1
    }
});