Code examples
/
Database APIs (g.sys.db)
Distinct with query
The code in every language
Each example is the inside of main, written in every language API Maker runs : pick yours in the tabs, and every page shows it from then on. The types a call takes (GetAll, DeepItem…) are those of am : from am import GetAll in Python, use am::GetAll; in Rust, import am.GetAll; in Java and Kotlin ; PHP and C# have them without an import, Go names them am.GetAll.
g.sys.db.distinctQuery calls the distinct with query schema API of any table from your code, with the same headers and query parameters as over HTTP. It returns the data. The whole envelope (success, statusCode, data, totalCount, errors…) comes back when true is passed as the second argument in TypeScript, and through full in the other languages : g.sys.db.full (g.Sys.Db.Full in C# and Go, $g->sys->db->full in PHP).
Simple get distinctWithQuery
TypeScript Python PHP C# Go Rust Java Kotlin
Simple distinctWithQuery let distinctQuery = await g . sys . db . distinctQuery ({
instance : "mysql_8" , database : "inventory" , collection : "customers" ,
distinctField : "first_name"
});
Simple distinctWithQuery distinct_query = await g . sys . db . distinct_query (
'mysql_8' , 'inventory' , 'customers' ,
'first_name' ,
)
Simple distinctWithQuery $distinctQuery = $g->sys->db->distinctQuery(
'mysql_8', 'inventory', 'customers',
'first_name',
);
Simple distinctWithQuery var distinctQuery = await g . Sys . Db . DistinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" ));
Simple distinctWithQuery distinctQuery , err := g . Sys . Db . DistinctQuery ( am . Distinct {
Instance : "mysql_8" , Database : "inventory" , Collection : "customers" ,
DistinctField : "first_name" ,
})
if err != nil {
return nil , err
}
Simple distinctWithQuery let distinct_query = g . sys . db . distinct_query ( Distinct :: new ( "mysql_8" , "inventory" , "customers" , "first_name" )) ? ;
Simple distinctWithQuery var distinctQuery = g . sys . db . distinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" ));
Simple distinctWithQuery val distinctQuery = g . sys . db . distinctQuery ( Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" ))
distinctWithQuery with multiple distinctField
TypeScript Python PHP C# Go Rust Java Kotlin
distinctWithQuery with multiple distinctField let distinctQuery = await g . sys . db . distinctQuery ({
instance : "mysql_8" , database : "inventory" , collection : "customers" ,
distinctField : "first_name,last_name"
});
distinctWithQuery with multiple distinctField distinct_query = await g . sys . db . distinct_query (
'mysql_8' , 'inventory' , 'customers' ,
'first_name,last_name' ,
)
distinctWithQuery with multiple distinctField $distinctQuery = $g->sys->db->distinctQuery(
'mysql_8', 'inventory', 'customers',
'first_name,last_name',
);
distinctWithQuery with multiple distinctField var distinctQuery = await g . Sys . Db . DistinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name,last_name" ));
distinctWithQuery with multiple distinctField distinctQuery , err := g . Sys . Db . DistinctQuery ( am . Distinct {
Instance : "mysql_8" , Database : "inventory" , Collection : "customers" ,
DistinctField : "first_name,last_name" ,
})
if err != nil {
return nil , err
}
distinctWithQuery with multiple distinctField let distinct_query = g . sys . db . distinct_query ( Distinct :: new ( "mysql_8" , "inventory" , "customers" , "first_name,last_name" )) ? ;
distinctWithQuery with multiple distinctField var distinctQuery = g . sys . db . distinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name,last_name" ));
distinctWithQuery with multiple distinctField val distinctQuery = g . sys . db . distinctQuery ( Distinct ( "mysql_8" , "inventory" , "customers" , "first_name,last_name" ))
TypeScript Python PHP C# Go Rust Java Kotlin
distinctWithQuery with headers let distinctQuery = await g . sys . db . distinctQuery ({
instance : "mysql_8" , database : "inventory" , collection : "customers" ,
distinctField : "first_name" ,
headers : {
"x-am-response-case" : "capitalCase" , // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
},
});
distinctWithQuery with headers distinct_query = await g . sys . db . distinct_query (
'mysql_8' , 'inventory' , 'customers' ,
'first_name' ,
headers = {
'x-am-response-case' : 'capitalCase' , # noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
},
)
distinctWithQuery with headers $distinctQuery = $g->sys->db->distinctQuery(
'mysql_8', 'inventory', 'customers',
'first_name',
headers: [
'x-am-response-case' => 'capitalCase', // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
],
);
distinctWithQuery with headers var distinctQuery = await g . Sys . Db . DistinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
{
Headers = new JsonObject
{
["x-am-response-case"] = "capitalCase" , // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
},
});
distinctWithQuery with headers distinctQuery , err := g . Sys . Db . DistinctQuery ( am . Distinct {
Instance : "mysql_8" , Database : "inventory" , Collection : "customers" ,
DistinctField : "first_name" ,
Headers : am . M {
"x-am-response-case" : "capitalCase" , // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
},
})
if err != nil {
return nil , err
}
distinctWithQuery with headers let distinct_query = g . sys . db . distinct_query (
Distinct :: new ( "mysql_8" , "inventory" , "customers" , "first_name" )
. headers ( json ! ({
"x-am-response-case" : "capitalCase" , // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
})),
) ? ;
distinctWithQuery with headers var distinctQuery = g . sys . db . distinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. headers ( Map . of (
"x-am-response-case" , "capitalCase" // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
)));
distinctWithQuery with headers val distinctQuery = g . sys . db . distinctQuery (
Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. headers ( mapOf (
"x-am-response-case" to "capitalCase" , // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
)),
)
distinctWithQuery with order
ascending
TypeScript Python PHP C# Go Rust Java Kotlin
distinctWithQuery with ascending order let distinctQuery = await g . sys . db . distinctQuery ({
instance : "mysql_8" , database : "inventory" , collection : "customers" ,
distinctField : "first_name" ,
order : "asc"
});
distinctWithQuery with ascending order distinct_query = await g . sys . db . distinct_query (
'mysql_8' , 'inventory' , 'customers' ,
'first_name' ,
order = 'asc' ,
)
distinctWithQuery with ascending order $distinctQuery = $g->sys->db->distinctQuery(
'mysql_8', 'inventory', 'customers',
'first_name',
order: 'asc',
);
distinctWithQuery with ascending order var distinctQuery = await g . Sys . Db . DistinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
{
Order = "asc" ,
});
distinctWithQuery with ascending order distinctQuery , err := g . Sys . Db . DistinctQuery ( am . Distinct {
Instance : "mysql_8" , Database : "inventory" , Collection : "customers" ,
DistinctField : "first_name" ,
Order : "asc" ,
})
if err != nil {
return nil , err
}
distinctWithQuery with ascending order let distinct_query = g . sys . db . distinct_query (
Distinct :: new ( "mysql_8" , "inventory" , "customers" , "first_name" )
. order ( "asc" ),
) ? ;
distinctWithQuery with ascending order var distinctQuery = g . sys . db . distinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. order ( "asc" ));
distinctWithQuery with ascending order val distinctQuery = g . sys . db . distinctQuery (
Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. order ( "asc" ),
)
descending
TypeScript Python PHP C# Go Rust Java Kotlin
distinctWithQuery with descending order let distinctQuery = await g . sys . db . distinctQuery ({
instance : "mysql_8" , database : "inventory" , collection : "customers" ,
distinctField : "first_name" ,
order : "desc"
});
distinctWithQuery with descending order distinct_query = await g . sys . db . distinct_query (
'mysql_8' , 'inventory' , 'customers' ,
'first_name' ,
order = 'desc' ,
)
distinctWithQuery with descending order $distinctQuery = $g->sys->db->distinctQuery(
'mysql_8', 'inventory', 'customers',
'first_name',
order: 'desc',
);
distinctWithQuery with descending order var distinctQuery = await g . Sys . Db . DistinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
{
Order = "desc" ,
});
distinctWithQuery with descending order distinctQuery , err := g . Sys . Db . DistinctQuery ( am . Distinct {
Instance : "mysql_8" , Database : "inventory" , Collection : "customers" ,
DistinctField : "first_name" ,
Order : "desc" ,
})
if err != nil {
return nil , err
}
distinctWithQuery with descending order let distinct_query = g . sys . db . distinct_query (
Distinct :: new ( "mysql_8" , "inventory" , "customers" , "first_name" )
. order ( "desc" ),
) ? ;
distinctWithQuery with descending order var distinctQuery = g . sys . db . distinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. order ( "desc" ));
distinctWithQuery with descending order val distinctQuery = g . sys . db . distinctQuery (
Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. order ( "desc" ),
)
distinctWithQuery with find
TypeScript Python PHP C# Go Rust Java Kotlin
distinctWithQuery with find let distinctQuery = await g . sys . db . distinctQuery ({
instance : "mysql_8" , database : "inventory" , collection : "customers" ,
distinctField : "first_name" ,
find : {
first_name : "Bob"
}
});
distinctWithQuery with find distinct_query = await g . sys . db . distinct_query (
'mysql_8' , 'inventory' , 'customers' ,
'first_name' ,
find = {
'first_name' : 'Bob' ,
},
)
distinctWithQuery with find $distinctQuery = $g->sys->db->distinctQuery(
'mysql_8', 'inventory', 'customers',
'first_name',
find: [
'first_name' => 'Bob',
],
);
distinctWithQuery with find var distinctQuery = await g . Sys . Db . DistinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
{
Find = new JsonObject
{
["first_name"] = "Bob" ,
},
});
distinctWithQuery with find distinctQuery , err := g . Sys . Db . DistinctQuery ( am . Distinct {
Instance : "mysql_8" , Database : "inventory" , Collection : "customers" ,
DistinctField : "first_name" ,
Find : am . M {
"first_name" : "Bob" ,
},
})
if err != nil {
return nil , err
}
distinctWithQuery with find let distinct_query = g . sys . db . distinct_query (
Distinct :: new ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( json ! ({
"first_name" : "Bob" ,
})),
) ? ;
distinctWithQuery with find var distinctQuery = g . sys . db . distinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( Map . of (
"first_name" , "Bob"
)));
distinctWithQuery with find val distinctQuery = g . sys . db . distinctQuery (
Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( mapOf (
"first_name" to "Bob" ,
)),
)
$lt distinctWithQuery
TypeScript Python PHP C# Go Rust Java Kotlin
distinctWithQuery with $lt let distinctQuery = await g . sys . db . distinctQuery ({
instance : "mysql_8" , database : "inventory" , collection : "customers" ,
distinctField : "first_name" ,
find : {
customer_id : {
"$lt" : 2
}
}
});
distinctWithQuery with $lt distinct_query = await g . sys . db . distinct_query (
'mysql_8' , 'inventory' , 'customers' ,
'first_name' ,
find = {
'customer_id' : {
'$lt' : 2 ,
},
},
)
distinctWithQuery with $lt $distinctQuery = $g->sys->db->distinctQuery(
'mysql_8', 'inventory', 'customers',
'first_name',
find: [
'customer_id' => [
'$lt' => 2,
],
],
);
distinctWithQuery with $lt var distinctQuery = await g . Sys . Db . DistinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
{
Find = new JsonObject
{
["customer_id"] = new JsonObject
{
["$lt"] = 2 ,
},
},
});
distinctWithQuery with $lt distinctQuery , err := g . Sys . Db . DistinctQuery ( am . Distinct {
Instance : "mysql_8" , Database : "inventory" , Collection : "customers" ,
DistinctField : "first_name" ,
Find : am . M {
"customer_id" : am . M {
"$lt" : 2 ,
},
},
})
if err != nil {
return nil , err
}
distinctWithQuery with $lt let distinct_query = g . sys . db . distinct_query (
Distinct :: new ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( json ! ({
"customer_id" : {
"$lt" : 2 ,
},
})),
) ? ;
distinctWithQuery with $lt var distinctQuery = g . sys . db . distinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( Map . of (
"customer_id" , Map . of (
"$lt" , 2
)
)));
distinctWithQuery with $lt val distinctQuery = g . sys . db . distinctQuery (
Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( mapOf (
"customer_id" to mapOf (
"\ $ lt " to 2 ,
),
)),
)
$lte distinctWithQuery
TypeScript Python PHP C# Go Rust Java Kotlin
distinctWithQuery with $lte let distinctQuery = await g . sys . db . distinctQuery ({
instance : "mysql_8" , database : "inventory" , collection : "customers" ,
distinctField : "first_name" ,
find : {
customer_id : {
"$lte" : 2
}
}
});
distinctWithQuery with $lte distinct_query = await g . sys . db . distinct_query (
'mysql_8' , 'inventory' , 'customers' ,
'first_name' ,
find = {
'customer_id' : {
'$lte' : 2 ,
},
},
)
distinctWithQuery with $lte $distinctQuery = $g->sys->db->distinctQuery(
'mysql_8', 'inventory', 'customers',
'first_name',
find: [
'customer_id' => [
'$lte' => 2,
],
],
);
distinctWithQuery with $lte var distinctQuery = await g . Sys . Db . DistinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
{
Find = new JsonObject
{
["customer_id"] = new JsonObject
{
["$lte"] = 2 ,
},
},
});
distinctWithQuery with $lte distinctQuery , err := g . Sys . Db . DistinctQuery ( am . Distinct {
Instance : "mysql_8" , Database : "inventory" , Collection : "customers" ,
DistinctField : "first_name" ,
Find : am . M {
"customer_id" : am . M {
"$lte" : 2 ,
},
},
})
if err != nil {
return nil , err
}
distinctWithQuery with $lte let distinct_query = g . sys . db . distinct_query (
Distinct :: new ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( json ! ({
"customer_id" : {
"$lte" : 2 ,
},
})),
) ? ;
distinctWithQuery with $lte var distinctQuery = g . sys . db . distinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( Map . of (
"customer_id" , Map . of (
"$lte" , 2
)
)));
distinctWithQuery with $lte val distinctQuery = g . sys . db . distinctQuery (
Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( mapOf (
"customer_id" to mapOf (
"\ $ lte " to 2 ,
),
)),
)
$gt distinctWithQuery
TypeScript Python PHP C# Go Rust Java Kotlin
distinctWithQuery with $gt let distinctQuery = await g . sys . db . distinctQuery ({
instance : "mysql_8" , database : "inventory" , collection : "customers" ,
distinctField : "first_name" ,
find : {
customer_id : {
"$gt" : 2
}
}
});
distinctWithQuery with $gt distinct_query = await g . sys . db . distinct_query (
'mysql_8' , 'inventory' , 'customers' ,
'first_name' ,
find = {
'customer_id' : {
'$gt' : 2 ,
},
},
)
distinctWithQuery with $gt $distinctQuery = $g->sys->db->distinctQuery(
'mysql_8', 'inventory', 'customers',
'first_name',
find: [
'customer_id' => [
'$gt' => 2,
],
],
);
distinctWithQuery with $gt var distinctQuery = await g . Sys . Db . DistinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
{
Find = new JsonObject
{
["customer_id"] = new JsonObject
{
["$gt"] = 2 ,
},
},
});
distinctWithQuery with $gt distinctQuery , err := g . Sys . Db . DistinctQuery ( am . Distinct {
Instance : "mysql_8" , Database : "inventory" , Collection : "customers" ,
DistinctField : "first_name" ,
Find : am . M {
"customer_id" : am . M {
"$gt" : 2 ,
},
},
})
if err != nil {
return nil , err
}
distinctWithQuery with $gt let distinct_query = g . sys . db . distinct_query (
Distinct :: new ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( json ! ({
"customer_id" : {
"$gt" : 2 ,
},
})),
) ? ;
distinctWithQuery with $gt var distinctQuery = g . sys . db . distinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( Map . of (
"customer_id" , Map . of (
"$gt" , 2
)
)));
distinctWithQuery with $gt val distinctQuery = g . sys . db . distinctQuery (
Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( mapOf (
"customer_id" to mapOf (
"\ $ gt " to 2 ,
),
)),
)
$gte distinctWithQuery
TypeScript Python PHP C# Go Rust Java Kotlin
distinctWithQuery with $gte let distinctQuery = await g . sys . db . distinctQuery ({
instance : "mysql_8" , database : "inventory" , collection : "customers" ,
distinctField : "first_name" ,
find : {
customer_id : {
"$gte" : 2
}
}
});
distinctWithQuery with $gte distinct_query = await g . sys . db . distinct_query (
'mysql_8' , 'inventory' , 'customers' ,
'first_name' ,
find = {
'customer_id' : {
'$gte' : 2 ,
},
},
)
distinctWithQuery with $gte $distinctQuery = $g->sys->db->distinctQuery(
'mysql_8', 'inventory', 'customers',
'first_name',
find: [
'customer_id' => [
'$gte' => 2,
],
],
);
distinctWithQuery with $gte var distinctQuery = await g . Sys . Db . DistinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
{
Find = new JsonObject
{
["customer_id"] = new JsonObject
{
["$gte"] = 2 ,
},
},
});
distinctWithQuery with $gte distinctQuery , err := g . Sys . Db . DistinctQuery ( am . Distinct {
Instance : "mysql_8" , Database : "inventory" , Collection : "customers" ,
DistinctField : "first_name" ,
Find : am . M {
"customer_id" : am . M {
"$gte" : 2 ,
},
},
})
if err != nil {
return nil , err
}
distinctWithQuery with $gte let distinct_query = g . sys . db . distinct_query (
Distinct :: new ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( json ! ({
"customer_id" : {
"$gte" : 2 ,
},
})),
) ? ;
distinctWithQuery with $gte var distinctQuery = g . sys . db . distinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( Map . of (
"customer_id" , Map . of (
"$gte" , 2
)
)));
distinctWithQuery with $gte val distinctQuery = g . sys . db . distinctQuery (
Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( mapOf (
"customer_id" to mapOf (
"\ $ gte " to 2 ,
),
)),
)
$eq distinctWithQuery
TypeScript Python PHP C# Go Rust Java Kotlin
distinctWithQuery with $eq let distinctQuery = await g . sys . db . distinctQuery ({
instance : "mysql_8" , database : "inventory" , collection : "customers" ,
distinctField : "first_name" ,
find : {
customer_id : {
"$eq" : 2
}
}
});
distinctWithQuery with $eq distinct_query = await g . sys . db . distinct_query (
'mysql_8' , 'inventory' , 'customers' ,
'first_name' ,
find = {
'customer_id' : {
'$eq' : 2 ,
},
},
)
distinctWithQuery with $eq $distinctQuery = $g->sys->db->distinctQuery(
'mysql_8', 'inventory', 'customers',
'first_name',
find: [
'customer_id' => [
'$eq' => 2,
],
],
);
distinctWithQuery with $eq var distinctQuery = await g . Sys . Db . DistinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
{
Find = new JsonObject
{
["customer_id"] = new JsonObject
{
["$eq"] = 2 ,
},
},
});
distinctWithQuery with $eq distinctQuery , err := g . Sys . Db . DistinctQuery ( am . Distinct {
Instance : "mysql_8" , Database : "inventory" , Collection : "customers" ,
DistinctField : "first_name" ,
Find : am . M {
"customer_id" : am . M {
"$eq" : 2 ,
},
},
})
if err != nil {
return nil , err
}
distinctWithQuery with $eq let distinct_query = g . sys . db . distinct_query (
Distinct :: new ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( json ! ({
"customer_id" : {
"$eq" : 2 ,
},
})),
) ? ;
distinctWithQuery with $eq var distinctQuery = g . sys . db . distinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( Map . of (
"customer_id" , Map . of (
"$eq" , 2
)
)));
distinctWithQuery with $eq val distinctQuery = g . sys . db . distinctQuery (
Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( mapOf (
"customer_id" to mapOf (
"\ $ eq " to 2 ,
),
)),
)
$ne distinctWithQuery
TypeScript Python PHP C# Go Rust Java Kotlin
distinctWithQuery with $ne let distinctQuery = await g . sys . db . distinctQuery ({
instance : "mysql_8" , database : "inventory" , collection : "customers" ,
distinctField : "first_name" ,
find : {
customer_id : {
"$ne" : 2
}
}
});
distinctWithQuery with $ne distinct_query = await g . sys . db . distinct_query (
'mysql_8' , 'inventory' , 'customers' ,
'first_name' ,
find = {
'customer_id' : {
'$ne' : 2 ,
},
},
)
distinctWithQuery with $ne $distinctQuery = $g->sys->db->distinctQuery(
'mysql_8', 'inventory', 'customers',
'first_name',
find: [
'customer_id' => [
'$ne' => 2,
],
],
);
distinctWithQuery with $ne var distinctQuery = await g . Sys . Db . DistinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
{
Find = new JsonObject
{
["customer_id"] = new JsonObject
{
["$ne"] = 2 ,
},
},
});
distinctWithQuery with $ne distinctQuery , err := g . Sys . Db . DistinctQuery ( am . Distinct {
Instance : "mysql_8" , Database : "inventory" , Collection : "customers" ,
DistinctField : "first_name" ,
Find : am . M {
"customer_id" : am . M {
"$ne" : 2 ,
},
},
})
if err != nil {
return nil , err
}
distinctWithQuery with $ne let distinct_query = g . sys . db . distinct_query (
Distinct :: new ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( json ! ({
"customer_id" : {
"$ne" : 2 ,
},
})),
) ? ;
distinctWithQuery with $ne var distinctQuery = g . sys . db . distinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( Map . of (
"customer_id" , Map . of (
"$ne" , 2
)
)));
distinctWithQuery with $ne val distinctQuery = g . sys . db . distinctQuery (
Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( mapOf (
"customer_id" to mapOf (
"\ $ ne " to 2 ,
),
)),
)
$not distinctWithQuery
TypeScript Python PHP C# Go Rust Java Kotlin
distinctWithQuery with $not let distinctQuery = await g . sys . db . distinctQuery ({
instance : "mysql_8" , database : "inventory" , collection : "customers" ,
distinctField : "first_name" ,
find : {
customer_id : {
"$not" : {
"$in" : [ 1 , 2 , 3 ]
}
}
}
});
distinctWithQuery with $not distinct_query = await g . sys . db . distinct_query (
'mysql_8' , 'inventory' , 'customers' ,
'first_name' ,
find = {
'customer_id' : {
'$not' : {
'$in' : [ 1 , 2 , 3 ],
},
},
},
)
distinctWithQuery with $not $distinctQuery = $g->sys->db->distinctQuery(
'mysql_8', 'inventory', 'customers',
'first_name',
find: [
'customer_id' => [
'$not' => [
'$in' => [1, 2, 3],
],
],
],
);
distinctWithQuery with $not var distinctQuery = await g . Sys . Db . DistinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
{
Find = new JsonObject
{
["customer_id"] = new JsonObject
{
["$not"] = new JsonObject
{
["$in"] = new JsonArray { 1 , 2 , 3 },
},
},
},
});
distinctWithQuery with $not distinctQuery , err := g . Sys . Db . DistinctQuery ( am . Distinct {
Instance : "mysql_8" , Database : "inventory" , Collection : "customers" ,
DistinctField : "first_name" ,
Find : am . M {
"customer_id" : am . M {
"$not" : am . M {
"$in" : [] any { 1 , 2 , 3 },
},
},
},
})
if err != nil {
return nil , err
}
distinctWithQuery with $not let distinct_query = g . sys . db . distinct_query (
Distinct :: new ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( json ! ({
"customer_id" : {
"$not" : {
"$in" : [ 1 , 2 , 3 ],
},
},
})),
) ? ;
distinctWithQuery with $not var distinctQuery = g . sys . db . distinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( Map . of (
"customer_id" , Map . of (
"$not" , Map . of (
"$in" , List . of ( 1 , 2 , 3 )
)
)
)));
distinctWithQuery with $not val distinctQuery = g . sys . db . distinctQuery (
Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( mapOf (
"customer_id" to mapOf (
"\ $ not " to mapOf (
"\ $ in " to listOf ( 1 , 2 , 3 ),
),
),
)),
)
$and distinctWithQuery
TypeScript Python PHP C# Go Rust Java Kotlin
distinctWithQuery with $and let distinctQuery = await g . sys . db . distinctQuery ({
instance : "mysql_8" , database : "inventory" , collection : "customers" ,
distinctField : "first_name" ,
find : {
"$and" : [
{
"customer_id" : 1
},
{
"zipcode" : 382345
}
]
}
});
distinctWithQuery with $and distinct_query = await g . sys . db . distinct_query (
'mysql_8' , 'inventory' , 'customers' ,
'first_name' ,
find = {
'$and' : [
{
'customer_id' : 1 ,
},
{
'zipcode' : 382345 ,
},
],
},
)
distinctWithQuery with $and $distinctQuery = $g->sys->db->distinctQuery(
'mysql_8', 'inventory', 'customers',
'first_name',
find: [
'$and' => [
[
'customer_id' => 1,
],
[
'zipcode' => 382345,
],
],
],
);
distinctWithQuery with $and var distinctQuery = await g . Sys . Db . DistinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
{
Find = new JsonObject
{
["$and"] = new JsonArray
{
new JsonObject
{
["customer_id"] = 1 ,
},
new JsonObject
{
["zipcode"] = 382345 ,
},
},
},
});
distinctWithQuery with $and distinctQuery , err := g . Sys . Db . DistinctQuery ( am . Distinct {
Instance : "mysql_8" , Database : "inventory" , Collection : "customers" ,
DistinctField : "first_name" ,
Find : am . M {
"$and" : [] any {
am . M {
"customer_id" : 1 ,
},
am . M {
"zipcode" : 382345 ,
},
},
},
})
if err != nil {
return nil , err
}
distinctWithQuery with $and let distinct_query = g . sys . db . distinct_query (
Distinct :: new ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( json ! ({
"$and" : [
{
"customer_id" : 1 ,
},
{
"zipcode" : 382345 ,
},
],
})),
) ? ;
distinctWithQuery with $and var distinctQuery = g . sys . db . distinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( Map . of (
"$and" , List . of (
Map . of (
"customer_id" , 1
),
Map . of (
"zipcode" , 382345
)
)
)));
distinctWithQuery with $and val distinctQuery = g . sys . db . distinctQuery (
Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( mapOf (
"\ $ and " to listOf (
mapOf (
"customer_id" to 1 ,
),
mapOf (
"zipcode" to 382345 ,
),
),
)),
)
$or distinctWithQuery
TypeScript Python PHP C# Go Rust Java Kotlin
distinctWithQuery with $or let distinctQuery = await g . sys . db . distinctQuery ({
instance : "mysql_8" , database : "inventory" , collection : "customers" ,
distinctField : "first_name" ,
find : {
"$or" : [
{
"customer_id" : 1
},
{
"zipcode" : 382345
}
]
}
});
distinctWithQuery with $or distinct_query = await g . sys . db . distinct_query (
'mysql_8' , 'inventory' , 'customers' ,
'first_name' ,
find = {
'$or' : [
{
'customer_id' : 1 ,
},
{
'zipcode' : 382345 ,
},
],
},
)
distinctWithQuery with $or $distinctQuery = $g->sys->db->distinctQuery(
'mysql_8', 'inventory', 'customers',
'first_name',
find: [
'$or' => [
[
'customer_id' => 1,
],
[
'zipcode' => 382345,
],
],
],
);
distinctWithQuery with $or var distinctQuery = await g . Sys . Db . DistinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
{
Find = new JsonObject
{
["$or"] = new JsonArray
{
new JsonObject
{
["customer_id"] = 1 ,
},
new JsonObject
{
["zipcode"] = 382345 ,
},
},
},
});
distinctWithQuery with $or distinctQuery , err := g . Sys . Db . DistinctQuery ( am . Distinct {
Instance : "mysql_8" , Database : "inventory" , Collection : "customers" ,
DistinctField : "first_name" ,
Find : am . M {
"$or" : [] any {
am . M {
"customer_id" : 1 ,
},
am . M {
"zipcode" : 382345 ,
},
},
},
})
if err != nil {
return nil , err
}
distinctWithQuery with $or let distinct_query = g . sys . db . distinct_query (
Distinct :: new ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( json ! ({
"$or" : [
{
"customer_id" : 1 ,
},
{
"zipcode" : 382345 ,
},
],
})),
) ? ;
distinctWithQuery with $or var distinctQuery = g . sys . db . distinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( Map . of (
"$or" , List . of (
Map . of (
"customer_id" , 1
),
Map . of (
"zipcode" , 382345
)
)
)));
distinctWithQuery with $or val distinctQuery = g . sys . db . distinctQuery (
Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( mapOf (
"\ $ or " to listOf (
mapOf (
"customer_id" to 1 ,
),
mapOf (
"zipcode" to 382345 ,
),
),
)),
)
$in distinctWithQuery
TypeScript Python PHP C# Go Rust Java Kotlin
distinctWithQuery with $in let distinctQuery = await g . sys . db . distinctQuery ({
instance : "mysql_8" , database : "inventory" , collection : "customers" ,
distinctField : "first_name" ,
find : {
customer_id : {
"$in" : [ 1 , 2 , 3 ]
}
}
});
distinctWithQuery with $in distinct_query = await g . sys . db . distinct_query (
'mysql_8' , 'inventory' , 'customers' ,
'first_name' ,
find = {
'customer_id' : {
'$in' : [ 1 , 2 , 3 ],
},
},
)
distinctWithQuery with $in $distinctQuery = $g->sys->db->distinctQuery(
'mysql_8', 'inventory', 'customers',
'first_name',
find: [
'customer_id' => [
'$in' => [1, 2, 3],
],
],
);
distinctWithQuery with $in var distinctQuery = await g . Sys . Db . DistinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
{
Find = new JsonObject
{
["customer_id"] = new JsonObject
{
["$in"] = new JsonArray { 1 , 2 , 3 },
},
},
});
distinctWithQuery with $in distinctQuery , err := g . Sys . Db . DistinctQuery ( am . Distinct {
Instance : "mysql_8" , Database : "inventory" , Collection : "customers" ,
DistinctField : "first_name" ,
Find : am . M {
"customer_id" : am . M {
"$in" : [] any { 1 , 2 , 3 },
},
},
})
if err != nil {
return nil , err
}
distinctWithQuery with $in let distinct_query = g . sys . db . distinct_query (
Distinct :: new ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( json ! ({
"customer_id" : {
"$in" : [ 1 , 2 , 3 ],
},
})),
) ? ;
distinctWithQuery with $in var distinctQuery = g . sys . db . distinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( Map . of (
"customer_id" , Map . of (
"$in" , List . of ( 1 , 2 , 3 )
)
)));
distinctWithQuery with $in val distinctQuery = g . sys . db . distinctQuery (
Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( mapOf (
"customer_id" to mapOf (
"\ $ in " to listOf ( 1 , 2 , 3 ),
),
)),
)
$nin distinctWithQuery
TypeScript Python PHP C# Go Rust Java Kotlin
distinctWithQuery with $nin let distinctQuery = await g . sys . db . distinctQuery ({
instance : "mysql_8" , database : "inventory" , collection : "customers" ,
distinctField : "first_name" ,
find : {
customer_id : {
"$nin" : [ 1 , 2 , 3 ]
}
}
});
distinctWithQuery with $nin distinct_query = await g . sys . db . distinct_query (
'mysql_8' , 'inventory' , 'customers' ,
'first_name' ,
find = {
'customer_id' : {
'$nin' : [ 1 , 2 , 3 ],
},
},
)
distinctWithQuery with $nin $distinctQuery = $g->sys->db->distinctQuery(
'mysql_8', 'inventory', 'customers',
'first_name',
find: [
'customer_id' => [
'$nin' => [1, 2, 3],
],
],
);
distinctWithQuery with $nin var distinctQuery = await g . Sys . Db . DistinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
{
Find = new JsonObject
{
["customer_id"] = new JsonObject
{
["$nin"] = new JsonArray { 1 , 2 , 3 },
},
},
});
distinctWithQuery with $nin distinctQuery , err := g . Sys . Db . DistinctQuery ( am . Distinct {
Instance : "mysql_8" , Database : "inventory" , Collection : "customers" ,
DistinctField : "first_name" ,
Find : am . M {
"customer_id" : am . M {
"$nin" : [] any { 1 , 2 , 3 },
},
},
})
if err != nil {
return nil , err
}
distinctWithQuery with $nin let distinct_query = g . sys . db . distinct_query (
Distinct :: new ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( json ! ({
"customer_id" : {
"$nin" : [ 1 , 2 , 3 ],
},
})),
) ? ;
distinctWithQuery with $nin var distinctQuery = g . sys . db . distinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( Map . of (
"customer_id" , Map . of (
"$nin" , List . of ( 1 , 2 , 3 )
)
)));
distinctWithQuery with $nin val distinctQuery = g . sys . db . distinctQuery (
Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( mapOf (
"customer_id" to mapOf (
"\ $ nin " to listOf ( 1 , 2 , 3 ),
),
)),
)
$like distinctWithQuery
TypeScript Python PHP C# Go Rust Java Kotlin
distinctWithQuery with $like let distinctQuery = await g . sys . db . distinctQuery ({
instance : "mysql_8" , database : "inventory" , collection : "customers" ,
distinctField : "first_name" ,
find : {
first_name : {
"$like" : "Bob%"
}
}
});
distinctWithQuery with $like distinct_query = await g . sys . db . distinct_query (
'mysql_8' , 'inventory' , 'customers' ,
'first_name' ,
find = {
'first_name' : {
'$like' : 'Bob%' ,
},
},
)
distinctWithQuery with $like $distinctQuery = $g->sys->db->distinctQuery(
'mysql_8', 'inventory', 'customers',
'first_name',
find: [
'first_name' => [
'$like' => 'Bob%',
],
],
);
distinctWithQuery with $like var distinctQuery = await g . Sys . Db . DistinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
{
Find = new JsonObject
{
["first_name"] = new JsonObject
{
["$like"] = "Bob%" ,
},
},
});
distinctWithQuery with $like distinctQuery , err := g . Sys . Db . DistinctQuery ( am . Distinct {
Instance : "mysql_8" , Database : "inventory" , Collection : "customers" ,
DistinctField : "first_name" ,
Find : am . M {
"first_name" : am . M {
"$like" : "Bob%" ,
},
},
})
if err != nil {
return nil , err
}
distinctWithQuery with $like let distinct_query = g . sys . db . distinct_query (
Distinct :: new ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( json ! ({
"first_name" : {
"$like" : "Bob%" ,
},
})),
) ? ;
distinctWithQuery with $like var distinctQuery = g . sys . db . distinctQuery ( new Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( Map . of (
"first_name" , Map . of (
"$like" , "Bob%"
)
)));
distinctWithQuery with $like val distinctQuery = g . sys . db . distinctQuery (
Distinct ( "mysql_8" , "inventory" , "customers" , "first_name" )
. find ( mapOf (
"first_name" to mapOf (
"\ $ like " to "Bob%" ,
),
)),
)
Structure
TypeScript Python PHP C# Go Rust Java Kotlin
Distinct Query let distinctQuery = await g . sys . db . distinctQuery ({
instance : "INSTANCE_NAME" , database : 'DB_NAME' , collection : "COLLECTION_NAME" ,
distinctField : "COLUMN_NAME" ,
order : "asc" , // asc | desc
find : {
"COLUMN_NAME" : "VALUE" ,
},
headers : {
"x-am-response-case" : "capitalCase" , // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
"x-am-response-object-type" : "make_flat" , // no_action | make_flat
"x-am-meta" : "true" , // true, false
"x-am-internationalization" : "USER_I18N_ID" ,
"x-am-run-in-sandbox" : "2" ,
"x-am-content-type-response" : "text/xml" , // application/json | text/xml | text/yaml | text/plain | text/html | application/octet-stream
"x-am-cache-control" : "reset_cache" , // no_action | reset_cache
"x-am-get-encrypted-data" : "get_only_encryption" , // no_encryption | get_only_encryption | get_data_and_encryption
"x-am-sandbox-timeout" : "13000" ,
"x-no-compression" : "true" , // true | false
"x-am-encrypted-payload" : "true" , // user will send 'true', when payload is encrypted for transfer
// Multi-tenant : the tenant of the request, each instance finds it in its own tenants table
"x-am-tenant-username" : "TENANT_USERNAME" , // ex: acme
// Authorization headers
"x-am-authorization" : "AUTHORIZATION_TOKEN" ,
"x-am-user-authorization" : "API_USER_TOKEN" ,
"x-aws-authorization" : "AWS_TOKEN" ,
"x-google-authorization" : "GOOGLE_TOKEN" ,
"x-azure-authorization" : "AZURE_TOKEN" ,
},
});
Distinct Query distinct_query = await g . sys . db . distinct_query (
'INSTANCE_NAME' , 'DB_NAME' , 'COLLECTION_NAME' ,
'COLUMN_NAME' ,
order = 'asc' , # asc | desc
find = {
'COLUMN_NAME' : 'VALUE' ,
},
headers = {
'x-am-response-case' : 'capitalCase' , # noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
'x-am-response-object-type' : 'make_flat' , # no_action | make_flat
'x-am-meta' : 'true' , # true, false
'x-am-internationalization' : 'USER_I18N_ID' ,
'x-am-run-in-sandbox' : '2' ,
'x-am-content-type-response' : 'text/xml' , # application/json | text/xml | text/yaml | text/plain | text/html | application/octet-stream
'x-am-cache-control' : 'reset_cache' , # no_action | reset_cache
'x-am-get-encrypted-data' : 'get_only_encryption' , # no_encryption | get_only_encryption | get_data_and_encryption
'x-am-sandbox-timeout' : '13000' ,
'x-no-compression' : 'true' , # true | false
'x-am-encrypted-payload' : 'true' , # user will send 'true', when payload is encrypted for transfer
# Multi-tenant : the tenant of the request, each instance finds it in its own tenants table
'x-am-tenant-username' : 'TENANT_USERNAME' , # ex: acme
# Authorization headers
'x-am-authorization' : 'AUTHORIZATION_TOKEN' ,
'x-am-user-authorization' : 'API_USER_TOKEN' ,
'x-aws-authorization' : 'AWS_TOKEN' ,
'x-google-authorization' : 'GOOGLE_TOKEN' ,
'x-azure-authorization' : 'AZURE_TOKEN' ,
},
)
Distinct Query $distinctQuery = $g->sys->db->distinctQuery(
'INSTANCE_NAME', 'DB_NAME', 'COLLECTION_NAME',
'COLUMN_NAME',
order: 'asc', // asc | desc
find: [
'COLUMN_NAME' => 'VALUE',
],
headers: [
'x-am-response-case' => 'capitalCase', // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
'x-am-response-object-type' => 'make_flat', // no_action | make_flat
'x-am-meta' => 'true', // true, false
'x-am-internationalization' => 'USER_I18N_ID',
'x-am-run-in-sandbox' => '2',
'x-am-content-type-response' => 'text/xml', // application/json | text/xml | text/yaml | text/plain | text/html | application/octet-stream
'x-am-cache-control' => 'reset_cache', // no_action | reset_cache
'x-am-get-encrypted-data' => 'get_only_encryption', // no_encryption | get_only_encryption | get_data_and_encryption
'x-am-sandbox-timeout' => '13000',
'x-no-compression' => 'true', // true | false
'x-am-encrypted-payload' => 'true', // user will send 'true', when payload is encrypted for transfer
// Multi-tenant : the tenant of the request, each instance finds it in its own tenants table
'x-am-tenant-username' => 'TENANT_USERNAME', // ex: acme
// Authorization headers
'x-am-authorization' => 'AUTHORIZATION_TOKEN',
'x-am-user-authorization' => 'API_USER_TOKEN',
'x-aws-authorization' => 'AWS_TOKEN',
'x-google-authorization' => 'GOOGLE_TOKEN',
'x-azure-authorization' => 'AZURE_TOKEN',
],
);
Distinct Query var distinctQuery = await g . Sys . Db . DistinctQuery ( new Distinct ( "INSTANCE_NAME" , "DB_NAME" , "COLLECTION_NAME" , "COLUMN_NAME" )
{
Order = "asc" , // asc | desc
Find = new JsonObject
{
["COLUMN_NAME"] = "VALUE" ,
},
Headers = new JsonObject
{
["x-am-response-case"] = "capitalCase" , // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
["x-am-response-object-type"] = "make_flat" , // no_action | make_flat
["x-am-meta"] = "true" , // true, false
["x-am-internationalization"] = "USER_I18N_ID" ,
["x-am-run-in-sandbox"] = "2" ,
["x-am-content-type-response"] = "text/xml" , // application/json | text/xml | text/yaml | text/plain | text/html | application/octet-stream
["x-am-cache-control"] = "reset_cache" , // no_action | reset_cache
["x-am-get-encrypted-data"] = "get_only_encryption" , // no_encryption | get_only_encryption | get_data_and_encryption
["x-am-sandbox-timeout"] = "13000" ,
["x-no-compression"] = "true" , // true | false
["x-am-encrypted-payload"] = "true" , // user will send 'true', when payload is encrypted for transfer
// Multi-tenant : the tenant of the request, each instance finds it in its own tenants table
["x-am-tenant-username"] = "TENANT_USERNAME" , // ex: acme
// Authorization headers
["x-am-authorization"] = "AUTHORIZATION_TOKEN" ,
["x-am-user-authorization"] = "API_USER_TOKEN" ,
["x-aws-authorization"] = "AWS_TOKEN" ,
["x-google-authorization"] = "GOOGLE_TOKEN" ,
["x-azure-authorization"] = "AZURE_TOKEN" ,
},
});
Distinct Query distinctQuery , err := g . Sys . Db . DistinctQuery ( am . Distinct {
Instance : "INSTANCE_NAME" , Database : "DB_NAME" , Collection : "COLLECTION_NAME" ,
DistinctField : "COLUMN_NAME" ,
Order : "asc" , // asc | desc
Find : am . M {
"COLUMN_NAME" : "VALUE" ,
},
Headers : am . M {
"x-am-response-case" : "capitalCase" , // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
"x-am-response-object-type" : "make_flat" , // no_action | make_flat
"x-am-meta" : "true" , // true, false
"x-am-internationalization" : "USER_I18N_ID" ,
"x-am-run-in-sandbox" : "2" ,
"x-am-content-type-response" : "text/xml" , // application/json | text/xml | text/yaml | text/plain | text/html | application/octet-stream
"x-am-cache-control" : "reset_cache" , // no_action | reset_cache
"x-am-get-encrypted-data" : "get_only_encryption" , // no_encryption | get_only_encryption | get_data_and_encryption
"x-am-sandbox-timeout" : "13000" ,
"x-no-compression" : "true" , // true | false
"x-am-encrypted-payload" : "true" , // user will send 'true', when payload is encrypted for transfer
// Multi-tenant : the tenant of the request, each instance finds it in its own tenants table
"x-am-tenant-username" : "TENANT_USERNAME" , // ex: acme
// Authorization headers
"x-am-authorization" : "AUTHORIZATION_TOKEN" ,
"x-am-user-authorization" : "API_USER_TOKEN" ,
"x-aws-authorization" : "AWS_TOKEN" ,
"x-google-authorization" : "GOOGLE_TOKEN" ,
"x-azure-authorization" : "AZURE_TOKEN" ,
},
})
if err != nil {
return nil , err
}
Distinct Query let distinct_query = g . sys . db . distinct_query (
Distinct :: new ( "INSTANCE_NAME" , "DB_NAME" , "COLLECTION_NAME" , "COLUMN_NAME" )
. order ( "asc" ) // asc | desc
. find ( json ! ({
"COLUMN_NAME" : "VALUE" ,
}))
. headers ( json ! ({
"x-am-response-case" : "capitalCase" , // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
"x-am-response-object-type" : "make_flat" , // no_action | make_flat
"x-am-meta" : "true" , // true, false
"x-am-internationalization" : "USER_I18N_ID" ,
"x-am-run-in-sandbox" : "2" ,
"x-am-content-type-response" : "text/xml" , // application/json | text/xml | text/yaml | text/plain | text/html | application/octet-stream
"x-am-cache-control" : "reset_cache" , // no_action | reset_cache
"x-am-get-encrypted-data" : "get_only_encryption" , // no_encryption | get_only_encryption | get_data_and_encryption
"x-am-sandbox-timeout" : "13000" ,
"x-no-compression" : "true" , // true | false
"x-am-encrypted-payload" : "true" , // user will send 'true', when payload is encrypted for transfer
// Multi-tenant : the tenant of the request, each instance finds it in its own tenants table
"x-am-tenant-username" : "TENANT_USERNAME" , // ex: acme
// Authorization headers
"x-am-authorization" : "AUTHORIZATION_TOKEN" ,
"x-am-user-authorization" : "API_USER_TOKEN" ,
"x-aws-authorization" : "AWS_TOKEN" ,
"x-google-authorization" : "GOOGLE_TOKEN" ,
"x-azure-authorization" : "AZURE_TOKEN" ,
})),
) ? ;
Distinct Query var distinctQuery = g . sys . db . distinctQuery ( new Distinct ( "INSTANCE_NAME" , "DB_NAME" , "COLLECTION_NAME" , "COLUMN_NAME" )
. order ( "asc" ) // asc | desc
. find ( Map . of (
"COLUMN_NAME" , "VALUE"
))
. headers ( JsonObject . of (
"x-am-response-case" , "capitalCase" , // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
"x-am-response-object-type" , "make_flat" , // no_action | make_flat
"x-am-meta" , "true" , // true, false
"x-am-internationalization" , "USER_I18N_ID" ,
"x-am-run-in-sandbox" , "2" ,
"x-am-content-type-response" , "text/xml" , // application/json | text/xml | text/yaml | text/plain | text/html | application/octet-stream
"x-am-cache-control" , "reset_cache" , // no_action | reset_cache
"x-am-get-encrypted-data" , "get_only_encryption" , // no_encryption | get_only_encryption | get_data_and_encryption
"x-am-sandbox-timeout" , "13000" ,
"x-no-compression" , "true" , // true | false
"x-am-encrypted-payload" , "true" , // user will send 'true', when payload is encrypted for transfer
// Multi-tenant : the tenant of the request, each instance finds it in its own tenants table
"x-am-tenant-username" , "TENANT_USERNAME" , // ex: acme
// Authorization headers
"x-am-authorization" , "AUTHORIZATION_TOKEN" ,
"x-am-user-authorization" , "API_USER_TOKEN" ,
"x-aws-authorization" , "AWS_TOKEN" ,
"x-google-authorization" , "GOOGLE_TOKEN" ,
"x-azure-authorization" , "AZURE_TOKEN"
)));
Distinct Query val distinctQuery = g . sys . db . distinctQuery (
Distinct ( "INSTANCE_NAME" , "DB_NAME" , "COLLECTION_NAME" , "COLUMN_NAME" )
. order ( "asc" ) // asc | desc
. find ( mapOf (
"COLUMN_NAME" to "VALUE" ,
))
. headers ( mapOf (
"x-am-response-case" to "capitalCase" , // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
"x-am-response-object-type" to "make_flat" , // no_action | make_flat
"x-am-meta" to "true" , // true, false
"x-am-internationalization" to "USER_I18N_ID" ,
"x-am-run-in-sandbox" to "2" ,
"x-am-content-type-response" to "text/xml" , // application/json | text/xml | text/yaml | text/plain | text/html | application/octet-stream
"x-am-cache-control" to "reset_cache" , // no_action | reset_cache
"x-am-get-encrypted-data" to "get_only_encryption" , // no_encryption | get_only_encryption | get_data_and_encryption
"x-am-sandbox-timeout" to "13000" ,
"x-no-compression" to "true" , // true | false
"x-am-encrypted-payload" to "true" , // user will send 'true', when payload is encrypted for transfer
// Multi-tenant : the tenant of the request, each instance finds it in its own tenants table
"x-am-tenant-username" to "TENANT_USERNAME" , // ex: acme
// Authorization headers
"x-am-authorization" to "AUTHORIZATION_TOKEN" ,
"x-am-user-authorization" to "API_USER_TOKEN" ,
"x-aws-authorization" to "AWS_TOKEN" ,
"x-google-authorization" to "GOOGLE_TOKEN" ,
"x-azure-authorization" to "AZURE_TOKEN" ,
)),
)
Multi-tenant
instance: "crm::acme" works on the database of the tenant acme of the multi-tenant instance crm.
With instance: "crm", the call works on the database of the tenant of the request: a custom API called with the x-am-tenant-username header passes it on to the APIs it calls. A request without a tenant works on the structure database.
TypeScript Python PHP C# Go Rust Java Kotlin
Distinct first names of some customers of the tenant acme let distinctQuery = await g . sys . db . distinctQuery ({
instance : "crm::acme" , database : "crm" , collection : "customers" ,
distinctField : "first_name" ,
find : {
"last_name" : "Lin"
}
});
Distinct first names of some customers of the tenant acme distinct_query = await g . sys . db . distinct_query (
'crm::acme' , 'crm' , 'customers' ,
'first_name' ,
find = {
'last_name' : 'Lin' ,
},
)
Distinct first names of some customers of the tenant acme $distinctQuery = $g->sys->db->distinctQuery(
'crm::acme', 'crm', 'customers',
'first_name',
find: [
'last_name' => 'Lin',
],
);
Distinct first names of some customers of the tenant acme var distinctQuery = await g . Sys . Db . DistinctQuery ( new Distinct ( "crm::acme" , "crm" , "customers" , "first_name" )
{
Find = new JsonObject
{
["last_name"] = "Lin" ,
},
});
Distinct first names of some customers of the tenant acme distinctQuery , err := g . Sys . Db . DistinctQuery ( am . Distinct {
Instance : "crm::acme" , Database : "crm" , Collection : "customers" ,
DistinctField : "first_name" ,
Find : am . M {
"last_name" : "Lin" ,
},
})
if err != nil {
return nil , err
}
Distinct first names of some customers of the tenant acme let distinct_query = g . sys . db . distinct_query (
Distinct :: new ( "crm::acme" , "crm" , "customers" , "first_name" )
. find ( json ! ({
"last_name" : "Lin" ,
})),
) ? ;
Distinct first names of some customers of the tenant acme var distinctQuery = g . sys . db . distinctQuery ( new Distinct ( "crm::acme" , "crm" , "customers" , "first_name" )
. find ( Map . of (
"last_name" , "Lin"
)));
Distinct first names of some customers of the tenant acme val distinctQuery = g . sys . db . distinctQuery (
Distinct ( "crm::acme" , "crm" , "customers" , "first_name" )
. find ( mapOf (
"last_name" to "Lin" ,
)),
)
Without a schema
g.sys.db.gen.distinctQueryGen takes the same arguments and calls the distinct with query generated API : no schema, so the data is read and written as it is in the table, without the conversions, validations and defaults of the schema.
Language
The call
TypeScript
g.sys.db.gen.distinctQueryGen(…)
Python
g.sys.db.gen.distinct_query_gen(…)
PHP
$g->sys->db->gen->distinctQueryGen(…)
C#, Go
g.Sys.Db.Gen.DistinctQueryGen(…)
Rust
g.sys.db.distinct_query_gen(Distinct::new(…))
Java, Kotlin
g.sys.db.gen.distinctQueryGen(…)