diff --git a/examples/aggregation/aggregation.bal b/examples/aggregation/aggregation.bal deleted file mode 100644 index c7451256f3..0000000000 --- a/examples/aggregation/aggregation.bal +++ /dev/null @@ -1,37 +0,0 @@ -import ballerina/io; - -public function main() returns error? { - var orders = [ - {orderId: 1, itemName: "A", price: 23.4, quantity: 2}, - {orderId: 1, itemName: "A", price: 20.4, quantity: 1}, - {orderId: 2, itemName: "B", price: 21.5, quantity: 3}, - {orderId: 1, itemName: "B", price: 21.5, quantity: 3} - ]; - - var items = from var {orderId, itemName} in orders - // The `group by` clause create groups for each `orderId`. - // The `itemName` is a non-grouping key and it becomes a sequence variable. - group by orderId - select [itemName]; - - // List of items per `orderId` - io:println(items); - - var quantities = from var {itemName, quantity} in orders - // The `group by` clause create groups for each `itemName`. - // The `quantity` is a non-grouping key and it becomes a sequence variable. - group by itemName - select {itemName, quantity: sum(quantity)}; - - // List of quantity per item - io:println(quantities); - - var income = from var {price, quantity} in orders - let var totPrice = price*quantity - // The `collect` clause creates a single group and all variables become - // non-grouping keys - collect sum(totPrice); - - // Total Income from orders - io:println(income); -} diff --git a/examples/aggregation/aggregation.md b/examples/aggregation/aggregation.md deleted file mode 100644 index ff5b269936..0000000000 --- a/examples/aggregation/aggregation.md +++ /dev/null @@ -1,21 +0,0 @@ -# Aggregation - -The `group by` clause in the query expression can group the elements in a collection. Grouping happens based on the grouping keys provided in `group by` clause. For each group, grouping keys are unique. All other variables other than grouping keys are called non-grouping keys. For each group, non-grouping keys become sequence variables. Those variables can be used as a list or an argument to a rest parameter of a langlib function. - -The `collect` clause collects the collection into one group. All the variables become aggregated variables and those variables can be used as a list or an argument to a rest parameter of a langlib function same as in `group by`. - -::: code aggregation.bal ::: - -::: out aggregation.out ::: - -## Related links -- [Query expressions](/learn/by-example/query-expressions) -- [Let clause in query expression](/learn/by-example/let-clause) -- [Limit clause in query expression](/learn/by-example/limit-clause) -- [Joining iterable objects using query](/learn/by-example/joining-iterable-objects) -- [Querying tables](/learn/by-example/querying-tables) -- [Create maps with query expression](/learn/by-example/create-maps-with-query) -- [Create tables with query expression](/learn/by-example/create-tables-with-query) -- [Create streams with query expression](/learn/by-example/create-streams-with-query) -- [On conflict clause in query expression](/learn/by-example/on-conflict-clause) -- [Nested query expressions](/learn/by-example/nested-query-expressions) diff --git a/examples/aggregation/aggregation.metatags b/examples/aggregation/aggregation.metatags deleted file mode 100644 index e6146e8607..0000000000 --- a/examples/aggregation/aggregation.metatags +++ /dev/null @@ -1,2 +0,0 @@ -description: This BBE demonstrates how to group a collection, how to handle non grouping keys. -keywords: ballerina, ballerina by example, bbe, group, non-grouping keys, aggregate, collect diff --git a/examples/aggregation/aggregation.out b/examples/aggregation/aggregation.out deleted file mode 100644 index 2636263ed2..0000000000 --- a/examples/aggregation/aggregation.out +++ /dev/null @@ -1,4 +0,0 @@ -$ bal run aggregation.bal -[["A","A","B"],["B"]] -[{"itemName":"A","quantity":3},{"itemName":"B","quantity":6}] -196.2 diff --git a/examples/graphql-client-error-handling/graphql_client_error_handling.md b/examples/graphql-client-error-handling/graphql_client_error_handling.md index 4e48d61c4a..08c312f748 100644 --- a/examples/graphql-client-error-handling/graphql_client_error_handling.md +++ b/examples/graphql-client-error-handling/graphql_client_error_handling.md @@ -13,4 +13,4 @@ Run the client program by executing the following command. ## Related links - [`graphql:ClientError` error - API documentation](https://lib.ballerina.io/ballerina/graphql/latest#ClientError) -- [GraphQL client error handling - Specification](/spec/graphql/#255-client-error-handling) +- [GraphQL client error handling - Specification](/spec/graphql/#63-client-error-handling) diff --git a/examples/graphql-client-security-basic-auth/graphql_client_security_basic_auth.md b/examples/graphql-client-security-basic-auth/graphql_client_security_basic_auth.md index 19112c40b7..f1a8c25e89 100644 --- a/examples/graphql-client-security-basic-auth/graphql_client_security_basic_auth.md +++ b/examples/graphql-client-security-basic-auth/graphql_client_security_basic_auth.md @@ -14,4 +14,4 @@ Run the client program by executing the following command. ## Related links - [`graphql:CredentialsConfig` record - API documentation](https://lib.ballerina.io/ballerina/graphql/latest#CredentialsConfig) - [`auth` module - API documentation](https://lib.ballerina.io/ballerina/auth/latest/) -- [GraphQL client basic authentication - Specification](/spec/graphql/#1221-basic-authentication) +- [GraphQL client basic authentication - Specification](/spec/graphql/#821-basic-authentication) diff --git a/examples/graphql-client-security-mutual-ssl/graphql_client_security_mutual_ssl.md b/examples/graphql-client-security-mutual-ssl/graphql_client_security_mutual_ssl.md index 0787e65790..7859100bf6 100644 --- a/examples/graphql-client-security-mutual-ssl/graphql_client_security_mutual_ssl.md +++ b/examples/graphql-client-security-mutual-ssl/graphql_client_security_mutual_ssl.md @@ -13,4 +13,4 @@ Run the client program by executing the following command. ## Related links - [`graphql:ClientSecureSocket` record - API documentation](https://lib.ballerina.io/ballerina/graphql/latest#ClientSecureSocket) -- [GraphQL client mutual SSL - Specification](/spec/graphql/#12322-mutual-ssl) +- [GraphQL client mutual SSL - Specification](/spec/graphql/#8322-mutual-ssl) diff --git a/examples/graphql-client-security-oauth2-password-grant-type/graphql_client_security_oauth2_password_grant_type.md b/examples/graphql-client-security-oauth2-password-grant-type/graphql_client_security_oauth2_password_grant_type.md index efcaca7052..eaeac0b2da 100644 --- a/examples/graphql-client-security-oauth2-password-grant-type/graphql_client_security_oauth2_password_grant_type.md +++ b/examples/graphql-client-security-oauth2-password-grant-type/graphql_client_security_oauth2_password_grant_type.md @@ -14,4 +14,4 @@ Run the client program by executing the command below. ## Related links - [`graphql:OAuth2PasswordGrantConfig` record - API documentation](https://lib.ballerina.io/ballerina/graphql/latest#OAuth2PasswordGrantConfig) - [`oauth2` module - API documentation](https://lib.ballerina.io/ballerina/oauth2/latest/) -- [GraphQL client OAuth2 password grant type - Specification](/spec/graphql/#12242-password-grant-type) +- [GraphQL client OAuth2 password grant type - Specification](/spec/graphql/#8242-password-grant-type) diff --git a/examples/graphql-client-security-self-signed-jwt-authentication/graphql_client_security_self_signed_jwt_authentication.md b/examples/graphql-client-security-self-signed-jwt-authentication/graphql_client_security_self_signed_jwt_authentication.md index ad209bb24e..3aebd64b4a 100644 --- a/examples/graphql-client-security-self-signed-jwt-authentication/graphql_client_security_self_signed_jwt_authentication.md +++ b/examples/graphql-client-security-self-signed-jwt-authentication/graphql_client_security_self_signed_jwt_authentication.md @@ -14,4 +14,4 @@ Run the client program by executing the command below. ## Related links - [`graphql:JwtIssuerConfig` record - API documentation](https://lib.ballerina.io/ballerina/graphql/latest#JwtIssuerConfig) - [`jwt` module - API documentation](https://lib.ballerina.io/ballerina/jwt/latest/) -- [GraphQL client self signed JWT authentication - Specification](/spec/graphql/#1223-self-signed-jwt-authentication) +- [GraphQL client self signed JWT authentication - Specification](/spec/graphql/#823-self-signed-jwt-authentication) diff --git a/examples/graphql-client-security-ssl-tls/graphql_client_security_ssl_tls.md b/examples/graphql-client-security-ssl-tls/graphql_client_security_ssl_tls.md index b7488a2ec7..bcb1192dfe 100644 --- a/examples/graphql-client-security-ssl-tls/graphql_client_security_ssl_tls.md +++ b/examples/graphql-client-security-ssl-tls/graphql_client_security_ssl_tls.md @@ -13,4 +13,4 @@ Run the client program by executing the following command. ## Related links - [`graphql:ClientSecureSocket` record - API documentation](https://lib.ballerina.io/ballerina/graphql/latest#ClientSecureSocket) -- [GraphQL client SSL/TLS - Specification](/spec/graphql/#12321-ssltls) +- [GraphQL client SSL/TLS - Specification](/spec/graphql/#8311-ssltls) diff --git a/examples/graphql-context/graphql_context.md b/examples/graphql-context/graphql_context.md index b7d11f47ad..5d82991fec 100644 --- a/examples/graphql-context/graphql_context.md +++ b/examples/graphql-context/graphql_context.md @@ -27,4 +27,4 @@ Now, send the same document with the `scope` header value set to `unknown`. This ## Related links - [`graphql:Context` object - API documentation](https://lib.ballerina.io/ballerina/graphql/latest#Context) -- [GraphQL context - Specification](/spec/graphql/#8-context-object) +- [GraphQL context - Specification](/spec/graphql/#101-context-object) diff --git a/examples/graphql-field-interceptors/graphql_field_interceptors.md b/examples/graphql-field-interceptors/graphql_field_interceptors.md index 3a84260756..0677296c23 100644 --- a/examples/graphql-field-interceptors/graphql_field_interceptors.md +++ b/examples/graphql-field-interceptors/graphql_field_interceptors.md @@ -22,4 +22,4 @@ To send the document, execute the following cURL command in a separate terminal. ## Related links - [`graphql:Interceptor` object - API documentation](https://lib.ballerina.io/ballerina/graphql/latest#Interceptor) -- [GraphQL interceptors - Specification](/spec/graphql/#11-interceptors) +- [GraphQL field interceptors - Specification](/spec/graphql/#10332-field-interceptors) diff --git a/examples/graphql-file-upload/graphql_file_upload.md b/examples/graphql-file-upload/graphql_file_upload.md index f8024b3b7e..068bc0c291 100644 --- a/examples/graphql-file-upload/graphql_file_upload.md +++ b/examples/graphql-file-upload/graphql_file_upload.md @@ -25,4 +25,4 @@ This will create a directory `uploads` where the service is running, and then sa ## Related links - [`graphql:Upload` record - API documentation](https://lib.ballerina.io/ballerina/graphql/latest#Upload) - [GraphQL multipart request specification](https://github.com/jaydenseric/graphql-multipart-request-spec) -- [GraphQL file upload - Specification](/spec/graphql/#6-file-upload) +- [GraphQL file upload - Specification](/spec/graphql/#104-file-upload) diff --git a/examples/graphql-graphiql/graphql_graphiql.md b/examples/graphql-graphiql/graphql_graphiql.md index c3cbcd939e..18df839583 100644 --- a/examples/graphql-graphiql/graphql_graphiql.md +++ b/examples/graphql-graphiql/graphql_graphiql.md @@ -17,5 +17,5 @@ To access the GraphiQL client, open a browser and access `http://localhost:9090/ ## Related links - [`graphql:ServiceConfig` annotation - API documentation](https://lib.ballerina.io/ballerina/graphql/latest#ServiceConfig) - [`graphql:GraphiQL` record - API documentation](https://lib.ballerina.io/ballerina/graphql/latest#Graphiql) -- [GraphQL GraphiQL client - Configuration](/spec/graphql/#1015-graphiql-configurations) -- [GraphQL GraphiQL client - Specification](/spec/graphql/#141-graphiql-client) +- [GraphQL GraphiQL client - Specification](/spec/graphql/#91-graphiql-client) +- [GraphQL GraphiQL client configuration - Specification](/spec/graphql/#715-graphiql-configurations) diff --git a/examples/graphql-input-constraint-validation/graphql_input_constraint_validation.md b/examples/graphql-input-constraint-validation/graphql_input_constraint_validation.md index af82c598ba..9e8d83d478 100644 --- a/examples/graphql-input-constraint-validation/graphql_input_constraint_validation.md +++ b/examples/graphql-input-constraint-validation/graphql_input_constraint_validation.md @@ -20,6 +20,6 @@ To send the document, execute the following cURL command in a separate terminal. ## Related links - [Constraint annotation - API documentation](https://lib.ballerina.io/ballerina/constraint/latest#Annotations) -- [GraphQL constraint config - API documentation](https://ballerina.io/spec/graphql/#1018-constraint-configurations) +- [GraphQL constraint config - Specification](/spec/graphql/#1018-constraint-configurations) - [`constraint` module - API documentation](https://lib.ballerina.io/ballerina/constraint/latest) - [`graphql` module - API documentation](https://lib.ballerina.io/ballerina/graphql/latest) diff --git a/examples/graphql-interceptor-configurations/graphql_interceptor_configurations.md b/examples/graphql-interceptor-configurations/graphql_interceptor_configurations.md index 8be707e01f..2b6508c842 100644 --- a/examples/graphql-interceptor-configurations/graphql_interceptor_configurations.md +++ b/examples/graphql-interceptor-configurations/graphql_interceptor_configurations.md @@ -25,4 +25,5 @@ To send the document, execute the following cURL command in a separate terminal. ## Related links - [`graphql:InterceptorConfig` annotation - API documentation](https://lib.ballerina.io/ballerina/graphql/latest#InterceptorConfig) -- [GraphQL interceptors - Specification](/spec/graphql/#11-interceptors) +- [GraphQL interceptor configuration - Specification](/spec/graphql/#73-interceptor-configuration) +- [GraphQL interceptors - Specification](/spec/graphql/#103-interceptors) diff --git a/examples/graphql-service-basic-auth-file-user-store/graphql_service_basic_auth_file_user_store.md b/examples/graphql-service-basic-auth-file-user-store/graphql_service_basic_auth_file_user_store.md index 83cb181695..a327c62154 100644 --- a/examples/graphql-service-basic-auth-file-user-store/graphql_service_basic_auth_file_user_store.md +++ b/examples/graphql-service-basic-auth-file-user-store/graphql_service_basic_auth_file_user_store.md @@ -20,4 +20,4 @@ Run the service by executing the command below. - [`graphql:ServiceConfig` annotation - API documentation](https://lib.ballerina.io/ballerina/graphql/latest#ServiceConfig) - [`graphql:FileUserStoreConfigWithScopes` record - API documentation](https://lib.ballerina.io/ballerina/graphql/latest#FileUserStoreConfigWithScopes) - [`auth` module - API documentation](https://lib.ballerina.io/ballerina/auth/latest/) -- [GraphQL service basic authentication - file user store - Specification](/spec/graphql/#12111-basic-authentication---file-user-store) +- [GraphQL service basic authentication - file user store - Specification](/spec/graphql/#8111-basic-authentication---file-user-store) diff --git a/examples/graphql-service-basic-auth-ldap-user-store/graphql_service_basic_auth_ldap_user_store.md b/examples/graphql-service-basic-auth-ldap-user-store/graphql_service_basic_auth_ldap_user_store.md index dec50f0e3c..2eba39022a 100644 --- a/examples/graphql-service-basic-auth-ldap-user-store/graphql_service_basic_auth_ldap_user_store.md +++ b/examples/graphql-service-basic-auth-ldap-user-store/graphql_service_basic_auth_ldap_user_store.md @@ -19,4 +19,4 @@ Run the service by executing the command below. - [`graphql:ServiceConfig` annotation - API documentation](https://lib.ballerina.io/ballerina/graphql/latest#ServiceConfig) - [`graphql:LdapUserStoreConfigWithScopes` record - API documentation](https://lib.ballerina.io/ballerina/graphql/latest#LdapUserStoreConfigWithScopes) - [`auth` module - API documentation](https://lib.ballerina.io/ballerina/auth/latest/) -- [GraphQL service basic authentication - LDAP user store - Specification](/spec/graphql/#12112-basic-authentication---ldap-user-store) +- [GraphQL service basic authentication - LDAP user store - Specification](/spec/graphql/#8112-basic-authentication---ldap-user-store) diff --git a/examples/graphql-service-error-handling/graphql_service_error_handling.md b/examples/graphql-service-error-handling/graphql_service_error_handling.md index 06b8962b77..286f95a277 100644 --- a/examples/graphql-service-error-handling/graphql_service_error_handling.md +++ b/examples/graphql-service-error-handling/graphql_service_error_handling.md @@ -32,4 +32,4 @@ Check the response to see how the `data` field is set to null due to propagating ## Related links - [`graphql` module - API documentation](https://lib.ballerina.io/ballerina/graphql/latest) -- [GraphQL error handling - Specification](/spec/graphql/#72-service-error-handling) +- [GraphQL error handling - Specification](/spec/graphql/#62-service-error-handling) diff --git a/examples/graphql-service-field-object/graphql_service_field_object.md b/examples/graphql-service-field-object/graphql_service_field_object.md index 8b7fce5754..434a5cfbd9 100644 --- a/examples/graphql-service-field-object/graphql_service_field_object.md +++ b/examples/graphql-service-field-object/graphql_service_field_object.md @@ -41,4 +41,4 @@ This will print a log message in the server terminal similar to the following lo ## Related links - [`graphql:Field` object - API documentation](https://lib.ballerina.io/ballerina/graphql/latest#Field) -- [GraphQL field - Specification](/spec/graphql/#9-field-object) +- [GraphQL field - Specification](/spec/graphql/#102-field-object) diff --git a/examples/graphql-service-interceptors/graphql_service_interceptors.md b/examples/graphql-service-interceptors/graphql_service_interceptors.md index dc1b207bbc..34f7aab36e 100644 --- a/examples/graphql-service-interceptors/graphql_service_interceptors.md +++ b/examples/graphql-service-interceptors/graphql_service_interceptors.md @@ -22,4 +22,4 @@ To send the document, execute the following cURL command in a separate terminal. ## Related links - [`graphql:Interceptor` object - API documentation](https://lib.ballerina.io/ballerina/graphql/latest#Interceptor) -- [GraphQL interceptors - Specification](/spec/graphql/#11-interceptors) +- [GraphQL service interceptors - Specification](/spec/graphql/#10331-service-interceptors) diff --git a/examples/graphql-service-jwt-auth/graphql_service_jwt_auth.md b/examples/graphql-service-jwt-auth/graphql_service_jwt_auth.md index 2628d12ebe..afc068d380 100644 --- a/examples/graphql-service-jwt-auth/graphql_service_jwt_auth.md +++ b/examples/graphql-service-jwt-auth/graphql_service_jwt_auth.md @@ -14,4 +14,4 @@ Run the service by executing the command below. - [`graphql:ServiceConfig` annotation - API documentation](https://lib.ballerina.io/ballerina/graphql/latest#ServiceConfig) - [`graphql:JwtValidatorConfigWithScopes` record - API documentation](https://lib.ballerina.io/ballerina/graphql/latest#JwtValidatorConfigWithScopes) - [`jwt` module - API documentation](https://lib.ballerina.io/ballerina/jwt/latest/) -- [GraphQL service JWT authentication - Specification](/spec/graphql/#12113-jwt-authentication) +- [GraphQL service JWT authentication - Specification](/spec/graphql/#8113-jwt-authentication) diff --git a/examples/graphql-service-mutual-ssl/graphql_service_mutual_ssl.md b/examples/graphql-service-mutual-ssl/graphql_service_mutual_ssl.md index d5f3d2b557..4a4fcfc646 100644 --- a/examples/graphql-service-mutual-ssl/graphql_service_mutual_ssl.md +++ b/examples/graphql-service-mutual-ssl/graphql_service_mutual_ssl.md @@ -13,4 +13,4 @@ Run the service by executing the command below. ## Related links - [`graphql:ListenerConfiguration` record - API documentation](https://lib.ballerina.io/ballerina/graphql/latest#ListenerConfiguration) - [`graphql:ListenerSecureSocket` record - API documentation](https://lib.ballerina.io/ballerina/graphql/latest#ListenerSecureSocket) -- [GraphQL service mutual SSL - Specification](/spec/graphql/#12312-mutual-ssl) +- [GraphQL service mutual SSL - Specification](/spec/graphql/#8312-mutual-ssl) diff --git a/examples/graphql-service-oauth2/graphql_service_oauth2.md b/examples/graphql-service-oauth2/graphql_service_oauth2.md index c44981e0a8..7c95fb0740 100644 --- a/examples/graphql-service-oauth2/graphql_service_oauth2.md +++ b/examples/graphql-service-oauth2/graphql_service_oauth2.md @@ -17,4 +17,4 @@ Run the service by executing the command below. - [`graphql:ServiceConfig` annotation - API documentation](https://lib.ballerina.io/ballerina/graphql/latest#ServiceConfig) - [`graphql:OAuth2IntrospectionConfigWithScopes` record - API documentation](https://lib.ballerina.io/ballerina/graphql/latest#OAuth2IntrospectionConfigWithScopes) - [`oauth2` module - API documentation](https://lib.ballerina.io/ballerina/oauth2/latest/) -- [GraphQL service OAuth2 - Specification](/spec/graphql/#12114-oauth2) +- [GraphQL service OAuth2 - Specification](/spec/graphql/#8114-oauth2) diff --git a/examples/graphql-service-ssl-tls/graphql_service_ssl_tls.md b/examples/graphql-service-ssl-tls/graphql_service_ssl_tls.md index 465c6812ac..6c4c2a9363 100644 --- a/examples/graphql-service-ssl-tls/graphql_service_ssl_tls.md +++ b/examples/graphql-service-ssl-tls/graphql_service_ssl_tls.md @@ -13,4 +13,4 @@ Run the service by executing the command below. ## Related links - [`graphql:ListenerConfiguration` record - API documentation](https://lib.ballerina.io/ballerina/graphql/latest#ListenerConfiguration) - [`graphql:ListenerSecureSocket` record - API documentation](https://lib.ballerina.io/ballerina/graphql/latest#ListenerSecureSocket) -- [GraphQL service SSL/TLS - Specification](/spec/graphql/#12311-ssltls) +- [GraphQL service SSL/TLS - Specification](/spec/graphql/#8311-ssltls) diff --git a/examples/index.json b/examples/index.json index a32bb1f660..373b0d84c7 100644 --- a/examples/index.json +++ b/examples/index.json @@ -3167,7 +3167,7 @@ "isLearnByExample": false }, { - "name": "Constraint validation", + "name": "Constraint validations", "url": "nats-service-constraint-validation", "verifyBuild": false, "verifyOutput": false, @@ -3177,7 +3177,7 @@ }, { "name": "Consume JetStream message", - "url": "nats-jestream-sub", + "url": "nats-jetstream-sub", "verifyBuild": false, "verifyOutput": false, "disableVerificationReason": "Includes ballerinax components", @@ -3211,7 +3211,7 @@ }, { "name": "Publish message", - "url": "nats-jestream-pub", + "url": "nats-jetstream-pub", "verifyBuild": false, "verifyOutput": false, "disableVerificationReason": "Includes ballerinax components", diff --git a/examples/nats-jetstream-pub/nats_jetstream_pub.out b/examples/nats-jetstream-pub/nats_jetstream_pub.client.out similarity index 100% rename from examples/nats-jetstream-pub/nats_jetstream_pub.out rename to examples/nats-jetstream-pub/nats_jetstream_pub.client.out diff --git a/gradle.properties b/gradle.properties index e342fb972b..38539ac022 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ group=org.ballerinalang version=2201.7.0-SNAPSHOT codeName=swan-lake -ballerinaLangVersion=2201.8.0-20230709-001900-fbfe9ee2 +ballerinaLangVersion=2201.8.0-20230712-000400-d08328e9 ballerinaJreVersion=1.1.0 dependencyJREVersion=jdk-11.0.18+10-jre specVersion=2023R1