Skip to content

Distinct

Structure

Distinct method
1
2
3
4
5
6
7
let distinct = await g.sys.db.gen.distinctQueryGen({
    instance: "INSTANCE_NAME",
    database: "DATABASE_NAME",
    collection: "COLLECTION_NAME",
    distinctField: "COLUMN_NAME",
    order: "asc"n
});

Simple distinct

Simple distinct
1
2
3
4
5
6
let distinct = await g.sys.db.gen.distinctQueryGen({
    instance: "mysql_8",
    database: "inventory",
    collection: "customers",
    distinctField: "first_name"
});

distinct with header

distinct with header
1
2
3
4
5
6
7
8
9
let distinct = await g.sys.db.gen.distinctQueryGen({
    instance: "mysql_8",
    database: "inventory",
    collection: "customers",
    distinctField: "first_name",
    headers: {
        "x-am-response-case": "capitalCase"
    }
});

distinct with order

ascending

distinct with order
1
2
3
4
5
6
7
let distinct = await g.sys.db.gen.distinctQueryGen({
    instance: "mysql_8",
    database: "inventory",
    collection: "customers",
    distinctField: "first_name",
    order: "asc"
});

descending

distinct with header
1
2
3
4
5
6
7
let distinct = await g.sys.db.gen.distinctQueryGen({
    instance: "mysql_8",
    database: "inventory",
    collection: "customers",
    distinctField: "first_name",
    order: "desc"
});

distinct with headers and order

distinct with header & order
let distinct = await g.sys.db.gen.distinctQueryGen({
    instance: "mysql_8",
    database: "inventory",
    collection: "customers",
    distinctField: "first_name",
    headers: {
        "x-am-response-case": "capitalCase"
    },
    order: "asc"
});