{"id":10253,"date":"2023-06-23T01:43:43","date_gmt":"2023-06-23T08:43:43","guid":{"rendered":"https:\/\/www.couchbase.com\/developers\/tutorials\/dart-flutter-query-sql\/"},"modified":"2023-06-23T01:43:43","modified_gmt":"2023-06-23T08:43:43","slug":"dart-flutter-query-sql","status":"publish","type":"tutorials","link":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/dart-flutter-query-sql\/","title":{"rendered":"Impara a utilizzare Couchbase Lite SQL++ per eseguire query con Dart e Flutter"},"content":{"rendered":"\n<h3 id=\"h-introduction\" class=\"wp-block-heading\">Introduction<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Couchbase Mobile supports SQL++ query strings using the SQL++ Query API.  SQL++ is Couchbase\u2019s declarative query language that extends SQL for JSON. The structure and semantics of the query format are based on that of Couchbase Server\u2019s SQL++ query language\u2009\u2014\u2009see <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/docs.couchbase.com\/server\/current\/n1ql\/n1ql-language-reference\/index.html\">N1QL Reference Guide<\/a> and <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/docs.couchbase.com\/server\/current\/learn\/data\/n1ql-versus-sql.html\">N1QL Data Model<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this step of the learning path you will learn the fundamentals of:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Querying using SQL++ Strings<\/li>\n\n\n<li>Using Live Queries with async streams<\/li>\n\n\n<li>Using JSON Serialization to &#8220;deserialize&#8221; documents from the database in to Dart data class<\/li>\n\n\n<li>Using indexes to speed up a query<\/li>\n\n\n<li>Using the count function with the SQL++ API<\/li>\n\n\n<li>Using the LIKE operator to search for documents with a specific value in a field<\/li>\n\n<\/ul>\n\n\n\n<h3 id=\"h-app-overview\" class=\"wp-block-heading\">App Overview<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">While the demo app has a lot of functionality, this step will walk you through:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Log in into the application<\/li>\n\n\n<li>Selecting a project from the list of projects<\/li>\n\n\n<li>Scrolling the list of stock items audited<\/li>\n\n\n<li>Review the code for displaying stock items that have been audited<\/li>\n\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>NOTE<\/strong>:  This step assumes you completed the previous step <code>Batch operations<\/code> that loaded the sample data into the application.  This part of the learning path will not work if you don&#8217;t complete the previous steps.<\/p>\n<\/blockquote>\n\n\n\n<h3 id=\"h-installation\" class=\"wp-block-heading\">Installation<\/h3>\n\n\n\n<h4 id=\"h-fetching-app-source-code\" class=\"wp-block-heading\">Fetching App Source Code<\/h4>\n\n\n\n<h5 id=\"h-clone-source-code\" class=\"wp-block-heading\">Clone Source Code<\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If you haven&#8217;t already cloned the repo from the previous step, clone the <code>Learn Couchbase Lite with Dart and Flutter<\/code> repository from GitHub.<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>git clone https:\/\/github.com\/couchbase-examples\/flutter_cbl_learning_path.git\n<\/code><\/pre>\n\n\n\n<h4 id=\"h-try-it-out\" class=\"wp-block-heading\">Try it out<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open src\/build.gradle using Android Studio.<\/li>\n\n\n<li>Build and run the project.<\/li>\n\n\n<li>Log in to the app with  <strong><em>&#8220;<a href=\"mailto:demo@example.com\">demo@example.com<\/a>&#8220;<\/em><\/strong> and <strong><em>&#8220;P@ssw0rd12&#8221;<\/em><\/strong> for user Id and password fields respectively.<\/li>\n\n\n<li>Verify that you see sample projects on the screen.  Tapping on a Project will bring up the audit inventory counts for that project.<\/li>\n\n\n<li>If you do not see sample projects and inventory audits, please complete the previous step <strong>Batch operations<\/strong> to load sample data before continuing.<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><img decoding=\"async\" src=\"audit_listing.gif\" alt=\"Audit Listing,400\"><\/p>\n\n\n\n<h4 id=\"h-the-audit-document\" class=\"wp-block-heading\">The Audit Document<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">The sample app was loaded with a collection of <code>Document<\/code> with a <em>&#8220;type&#8221;<\/em> property of <em>&#8220;audit&#8221;<\/em> in the previous sections of the learning path.  Each document represents a item that that a team would would record with how many of those items they found in the warehouse while working on a project.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An example of a document would be:<\/p>\n\n\n\n<pre class=\"wp-block-code language-json\"><code>{\n\t&quot;team&quot;: &quot;team1&quot;,\n\t&quot;modifiedOn&quot;: &quot;2022\/10\/12&quot;,\n\t&quot;documentType&quot;: &quot;audit&quot;,\n\t&quot;createdBy&quot;: &quot;demo@example.com&quot;,\n\t&quot;modifiedBy&quot;: &quot;demo@example.com&quot;,\n\t&quot;projectId&quot;: &quot;c4a8fbac-083a-4ad5-87e5-2fe1c03a3689&quot;,\n\t&quot;createdOn&quot;: &quot;2022\/10\/12&quot;,\n\t&quot;auditId&quot;: &quot;d3fb4d2e-0c75-4a85-b9b9-418a3b5f8303&quot;,\n\t&quot;notes&quot;: &quot;Found item Langres Psion Ale - Sweet Ale with Langres flavors in warehouse&quot;,\n\t&quot;auditCount&quot;: 42330,\n\t&quot;stockItem&quot;: {\n\t\t&quot;name&quot;: &quot;Langres Psion Ale&quot;,\n\t\t&quot;description&quot;: &quot;Sweet Ale with Langres flavors&quot;,\n\t\t&quot;itemId&quot;: &quot;e53dddf3-2058-4963-9293-66a87c84b29b&quot;,\n\t\t&quot;price&quot;: 52.76,\n    &quot;style&quot;: &quot;Imperial Stout&quot;\n\t}\n}\n<\/code><\/pre>\n\n\n\n<h5 id=\"h-the-audit-data-class\" class=\"wp-block-heading\">The Audit Data Class<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">When a <em>&#8220;audit&#8221;<\/em> item is retreived from the database it is stored within an data class of type <strong>Audit<\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-code language-dart\"><code>@JsonSerializable(explicitToJson: true)\nclass Audit {\n String auditId;\n String projectId;\n StockItem? stockItem;\n int auditCount;\n String notes;\n String documentType = &quot;audit&quot;;\n\n \/\/security tracking\n String team;\n String createdBy;\n String modifiedBy;\n DateTime? createdOn;\n DateTime? modifiedOn;\n\n Audit({\n  required this.auditId,\n  required this.projectId,\n  required this.stockItem,\n  required this.auditCount,\n  required this.notes,\n  required this.team,\n  required this.createdBy,\n  required this.modifiedBy,\n  required this.createdOn,\n  required this.modifiedOn});\n\n factory Audit.fromJson(Map&lt;String, dynamic&gt; json) =&gt; _$AuditFromJson(json);\n\n Map&lt;String, dynamic&gt; toJson() =&gt; _$AuditToJson(this);\n}\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-exploring-the-sql-query-string-api-with-the-count-function\" class=\"wp-block-heading\">Exploring the SQL++ Query String API with the Count Function<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The SQL++ Query String API in Couchbase Lite is extensive.  On the Developer &#8211; Database Information screen we display the number of audit documents found in the inventory database.  The <code>SQL++ Query String<\/code> API along with the count function was used to calculate this number.  To see the Developer Information screen:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Launch the Invenory Application on your emulator<\/li>\n\n\n<li>Login in using the username <em><a href=\"mailto:demo@example.com\">demo@example.com<\/a><\/em> and password <em>P@ssw0rd12<\/em><\/li>\n\n\n<li>Click the Drawer menu icon (sometimes referred to the Hamburger icon) and tap on Developer<\/li>\n\n\n<li>Tap on the Database Information button<\/li>\n\n<\/ul>\n\n\n\n<h4 id=\"h-counting-number-of-documents-by-type\" class=\"wp-block-heading\">Counting number of documents by type<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">The &#8220;DeveloperInfoWidget&#8221; screen displays the count of how many documents are in the inventory database with the type set to &#8216;audit&#8217;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><img decoding=\"async\" src=\"dev_info_count.png\" alt=\"Developer - Database Information\" title=\"#width=400px\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The DeveloperInfoWidget class obtains this information from the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/github.com\/couchbase-examples\/flutter_cbl_learning_path\/blob\/main\/src\/lib\/features\/developer\/bloc\/dev_info_bloc.dart#L47\"> <strong>DevInfoBloc<\/strong><\/a> class, which emits this information.   The <code>DevInfoBloc<\/code> calls the AutitRepository which runs the query to calculate the count.<\/p>\n\n\n\n<pre class=\"wp-block-code language-dart\"><code>final auditCounter = await _auditRepository.count();\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/github.com\/couchbase-examples\/flutter_cbl_learning_path\/blob\/main\/src\/lib\/features\/audit\/data\/audit_repository.dart#L72\"> <strong>audit_repository.dart<\/strong><\/a> file and locate the <code>count<\/code> function.<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-dart\"><code>Future&lt;int&gt; count() async {\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>We build the Query using the <code>SQL++ Query String<\/code> API that will look for Documents that match the specified criteria.<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-kotlin\"><code>var count = 0;\ntry {\n var attributeCount = &#039;count&#039;;\n\n var db = _databaseProvider.inventoryDatabase;\n if (db != null) {\n  var query = await AsyncQuery.fromN1ql(db,\n   &#039;SELECT COUNT(*) AS count FROM _ AS item WHERE documentType=&quot;$auditDocumentType&quot;&#039;); \/\/ &lt;1&gt;\n  var result = await query.execute(); \/\/ &lt;2&gt;\n  var results = await result.allResults(); \/\/ &lt;3&gt;\n  count = results.first.integer(attributeCount); \/\/ &lt;4&gt;\n }\n} catch (e) {\n debugPrint(e.toString());\n}\nreturn count;\n<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Call the AsyncQuery API fromN1ql method and passing the database and the query as a string.<\/li>\n\n\n<li>We run the Query by calling the <code>execute()<\/code> method.<\/li>\n\n\n<li>We run the <code>allResults()<\/code> method to get all the results from the result.<\/li>\n\n\n<li>We get the results by looking at the first result in the collection and getting an integer value for the key &#8220;count&#8221; which we defined in the <code>SELECT<\/code> clause<\/li>\n\n<\/ol>\n\n\n\n<h3 id=\"h-futher-exploring-the-sql-query-string-api\" class=\"wp-block-heading\">Futher Exploring the SQL++ Query String API<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">There are several minor but notable behavior differences between SQL++ for Mobile queries and N1QL for Server.  More information on the differences can be found in the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/docs.couchbase.com\/couchbase-lite\/current\/swift\/query-n1ql-mobile-server-diffs.html\">SQL++ Server Differences<\/a> documentation. In our example, we will be using the API to make a simple <em>pattern matching<\/em> query using the equalTo operator.  This example will use Live Query with Dart to return a stream of changes.<\/p>\n\n\n\n<h4 id=\"h-fetching-audit-documents\" class=\"wp-block-heading\">Fetching Audit Documents<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">From the &#8220;Login&#8221; screen, when a user logs in with the proper credentials they are presented with a list of projects there team is assigned to work on.  From the project listing when a user taps on a project they are presented with a listing of audit items that was recorded as inventory items at the location of the project.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n<p>Open the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/github.com\/couchbase-examples\/flutter_cbl_learning_path\/blob\/main\/src\/lib\/features\/audit\/views\/audit_list_widget.dart#L17\"> <strong>audit_list_widget.dart<\/strong><\/a> file and locate the <code>build<\/code> function.<\/p>\n<\/li>\n\n\n<li>\n<p>The live query is an <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/api.dart.dev\/stable\/2.18.2\/dart-async\/Stream-class.html\">AsyncListenStream<t><\/t><\/a> which is emit to state as List<audit> in the <code>AuditListBloc<\/code>.<\/audit><\/p>\n<\/li>\n\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>TIP<\/strong>:  Anytime documents change or are added to the database that satisify this query, the listen(change) would fire in the AuditListBloc and the AuditListBloc would fire the AuditListLoadedEvent that would update state.  The <code>live query<\/code> API can dynmamically update your UI without the need for end user interaction, which will come in handy in future sections of the learning path when we review replication.<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code language-dart\"><code>case DataStatus.loaded:\ncase DataStatus.changed:\n return SafeArea(\n  child: ListView.builder(\n   itemCount: state.items.length,\n   itemBuilder: (BuildContext context, int index) {\n    return  GestureDetector(\n     onTap: () =&gt; {\n      routerService.routeTo(\n       ScreenRoute(\n        routeToScreen: RouteToScreen.auditEditor,\n        audit: state.items[index],\n        projectId: state.items[index].projectId)\n      )\n    },\n  child: AuditCard(item: state.items[index], routerService: routerService)\n  );\n}));\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>To see how the <code>List&lt;Audit&gt;<\/code> items is created, open the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/github.com\/couchbase-examples\/flutter_cbl_learning_path\/blob\/main\/src\/lib\/features\/audit\/bloc\/audit_list_bloc.dart#L44\"> <strong>audit_list_bloc.dart<\/strong><\/a> file and locate the <code>_onInitialize<\/code> function.<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-dart\"><code>  Future&lt;void&gt; _onInitialize (\n      AuditListInitializeEvent event, \n      Emitter&lt;AuditListState&gt; emit) async {\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The bloc listens to the stream provided by the <code>AuditRepository.getDocuments<\/code> method.<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-dart\"><code>try {\n emit(state.copyWith(status: DataStatus.loading));\n \/\/ &lt;1&gt;\n var stream = await _repository.getDocuments(event.projectId);\n \/\/ &lt;2&gt;\n if (stream != null) {\n  \/\/ &lt;3&gt;\n  stream.listen((change) async {\n  \/\/ &lt;4&gt;\n   var items = &lt;Audit&gt;[];\n   \/\/ &lt;5&gt;\n   var results = await change.results.allResults();\n   \/\/&lt;6&gt;\n   for (var result in results) {\n    \/\/ &lt;7&gt;\n    var map = result.toPlainMap();\n    var dao = AuditDao.fromJson(map);\n    \/\/ &lt;8&gt;\n    items.add(dao.item);\n   }\n  \/\/ &lt;9&gt;\n  add(AuditListLoadedEvent(items: items));\n  });\n }\n} catch (e) {\n emit(state.copyWith(status: DataStatus.error, error: e.toString()));\n debugPrint(e.toString());\n}\n<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Get the stream from the repository based on passing the projectId that was selected.<\/li>\n\n\n<li>Check the stream to see if it is null.  If it is not null, then we will listen to the stream.<\/li>\n\n\n<li>Listen to the stream for changes via the <code>change<\/code> parameter.<\/li>\n\n\n<li>Create local variable to hold the list of Audits items.<\/li>\n\n\n<li>Get the <code>ResultSet<\/code> from the change object.<\/li>\n\n\n<li>Loop through the results in the Result Set.<\/li>\n\n\n<li>Convert the results to a plain map and then to a DOA (Data Access Object).<\/li>\n\n\n<li>Add the Audit item to the list.<\/li>\n\n\n<li>If the bloc is not closed, then emit the AuditListLoadedEvent with the list of Audit items.  The bloc could be closed for several reasons including the app going to the background.  If the change fires reason while the app is in the background, this would be bad since the application is not in the foreground and the UI can&#8217;t be updated.  The <code>isClosed<\/code> check prevents this from happening.<\/li>\n\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>To see how to build a live query that returns a stream, open the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/github.com\/couchbase-examples\/flutter_cbl_learning_path\/blob\/main\/src\/lib\/features\/audit\/data\/audit_repository.dart#L19\"> <strong>audit_repository.dart<\/strong><\/a> file and locate the getDocuments function.<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-dart\"><code>Future&lt;AsyncListenStream&lt;QueryChange&lt;ResultSet&gt;&gt;?&gt;? getDocuments(String projectId) async {\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>We first get the current authenticated user so we can get the team that the user is assigned to.<\/li>\n\n\n<li>Next we build a Query using the AsyncQuery classes fromN1ql method that takes in a database and SQL++ query.  Notice how parameter names start with a dollar sign and the dollar sign must be escaped with a .<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-dart\"><code>\/\/ &lt;1&gt;\nvar query = await AsyncQuery.fromN1ql(db, &quot;SELECT * FROM _ AS item WHERE documentType=&quot;audit&quot; AND projectId=$projectId AND team=$team&quot;);\n\n\/\/&lt;2&gt;\nvar parameters = Parameters();\nparameters.setValue(projectId, name: &quot;projectId&quot;);\nparameters.setValue(team, name: &quot;team&quot;);\n\n\/\/&lt;3&gt;\nawait query.setParameters(parameters);\nreturn query.changes();\n<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Build a query using the AsyncQuery <code>fromN1ql<\/code> method<\/li>\n\n\n<li>Create a paramters collection to store the parameters in.  Add the parameters and there values to the collection.<\/li>\n\n\n<li>Set the query parameters property to the parameter collection and return the stream.<\/li>\n\n<\/ol>\n\n\n\n<h5 id=\"h-indexing-the-query\" class=\"wp-block-heading\">Indexing the Query<\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n<p>Creating indexes for non-FTS based queries is optional. However, to speed up queries, you can create indexes on the properties that you would query against. Indexing is handled eagerly.<\/p>\n<\/li>\n\n\n<li>\n<p>In the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/github.com\/couchbase-examples\/flutter_cbl_learning_path\/blob\/main\/src\/lib\/features\/database\/database_provider.dart#L254\"><strong>database_provider.dart<\/strong><\/a>  file, locate the <code>createAuditIndex<\/code> function.<\/p>\n<\/li>\n\n\n<li>\n<p>We create an index on the <code>type<\/code>, <code>projectId<\/code>, and <code>team<\/code> properties of the documents in the <em>inventory<\/em> database.<\/p>\n<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-dart\"><code>Future&lt;void&gt; _createAuditIndex() async {\n final documentTypeExpression =\n  Expression.property(documentTypeAttributeName);\n final projectIdExpression = Expression.property(projectIdAttributeName);\n final teamExpression = Expression.property(teamAttributeName);\n\n final valueIndexItems = {\n  ValueIndexItem.expression(documentTypeExpression),\n  ValueIndexItem.expression(projectIdExpression),\n  ValueIndexItem.expression(teamExpression),\n };\n\n final index = IndexBuilder.valueIndex(valueIndexItems);\n\n var inventoryDb = inventoryDatabase;\n if (inventoryDb != null) {\n  final indexes = await inventoryDb.indexes;\n  if (!(indexes.contains(auditIndexName))) {\n   await inventoryDb.createIndex(auditIndexName, index);\n  }\n }\n}\n<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Create the expresion for the <code>documentType<\/code> attribute.<\/li>\n\n\n<li>Create the expresion for the <code>projectId<\/code> attribute.<\/li>\n\n\n<li>Create the expression for the <code>team<\/code> attribute.<\/li>\n\n\n<li>Create a collection of valueIndexItems to set the index to.<\/li>\n\n\n<li>Create the index using the IndexBuilder API.<\/li>\n\n\n<li>Get a reference to the <em>inventory<\/em> database for null checking purproses.<\/li>\n\n\n<li>Check the database to make sure it&#8217;s not null<\/li>\n\n\n<li>Get the list of indexes from the database.  We don&#8217;t want to try to create the index if it already exists.<\/li>\n\n\n<li>Check to see if the index already exists.<\/li>\n\n\n<li>If the index doesn&#8217;t exist, then create it.<\/li>\n\n<\/ol>\n\n\n\n<h3 id=\"h-sql-query-string-api-searching-for-stock-items-with-the-like-operator\" class=\"wp-block-heading\">SQL++ Query String API &#8211; Searching for Stock Items with the LIKE Operator<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The SQL ++ Query String API supports serveral operators including the LIKE which can be used for string matching.  We use the LIKE operator on the data editor screen for audits to find a stock item to add to a audit.  Let&#8217;s review the code.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>NOTE<\/strong>: The like operator performs case sensitive matches.  To perform case insensitive matching, use lowercase or uppercase functions to ensure all comparators have the same case, thereby removing the case issue.<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">On the Audit Editor screen we provide a link to the Stock Item Section screen.  To see the Audit Editor screen:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Launch the Invenory Application on your emulator<\/li>\n\n\n<li>Login in using the username <em><a href=\"mailto:demo@example.com\">demo@example.com<\/a><\/em> and password <em>P@ssw0rd12<\/em><\/li>\n\n\n<li>Tap on one of the Projects to bring up the Audit List screen<\/li>\n\n\n<li>Tap the + button to add a new audit<\/li>\n\n\n<li>Tap the button <code>Select Stock Item<\/code><\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><img decoding=\"async\" src=\"audit_editor_screen_noitem.selected.png\" alt=\"Audit Editor screen\" title=\"#width=300px\"><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>In the Name box enter ipa<\/li>\n\n\n<li>In the Description box enter pepper<\/li>\n\n\n<li>Hit the Search button<\/li>\n\n\n<li>A listing of stock items should return that match these results<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><img decoding=\"async\" src=\"select_audit_stockitem.png\" alt=\"Select Stock Item screen\" title=\"#width=300px\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s review the code for the Stock Item Section screen.<\/p>\n\n\n\n<h4 id=\"h-stock-item-selection\" class=\"wp-block-heading\">Stock Item Selection<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n<p>Open the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/github.com\/couchbase-examples\/flutter_cbl_learning_path\/blob\/main\/src\/lib\/features\/audit\/views\/audit_editor_form.dart#L222\"> <strong>audit_editor_form.dart<\/strong><\/a> file and locate the <code>_StockItemSearchButton<\/code> class.<\/p>\n<\/li>\n\n\n<li>\n<p>The build method adds an Elevated Button<\/p>\n<\/li>\n\n\n<li>\n<p>The onPressed method adds the blocs StockItemSearchSubmitChangedEvent when a user taps on the Search button.<\/p>\n<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-dart\"><code>Widget build(BuildContext context) {\n return BlocBuilder&lt;StockItemSearchBloc, StockItemSearchState&gt;(\n  builder: (context, state) {\n   if (state.status == FormEditorStatus.dataSaved ||\n    state.status == FormEditorStatus.cancelled) {\n     Navigator.of(context).pop();\n    return const Text(&#039;&#039;);\n   } else {\n    return Padding(\n     padding: const EdgeInsets.only(top: 16.0, left: 8.0, right: 8.0),\n     child: ElevatedButton(\n      onPressed: () {\n       context\n        .read&lt;StockItemSearchBloc&gt;()\n        .add(const StockItemSearchSubmitChangedEvent());\n      },\n      child: const Padding(\n       padding: EdgeInsets.all(8.0),\n        child: Text(\n         &quot;Search&quot;,\n         style: TextStyle(color: Colors.white, fontSize: 24.0),\n    ))),\n   );\n  }\n });\n}\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/github.com\/couchbase-examples\/flutter_cbl_learning_path\/blob\/main\/src\/lib\/features\/audit\/bloc\/stockitem_search_bloc.dart#L40\"> <strong>stockitem_search_bloc.dart<\/strong><\/a> file and locate the <code>_onSubmitted<\/code> method.<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-dart\"><code>FutureOr&lt;void&gt; _onSubmitted(\n StockItemSearchSubmitChangedEvent event,\n Emitter&lt;StockItemSearchState&gt; emit) async {\n\n if (state.searchName.isNotEmpty){\n  try {\n   var items = await _repository.search(state.searchName, state.searchDescription);\n   if (items.isNotEmpty){\n    emit(state.copyWith(error: &#039;&#039;, status: FormEditorStatus.dataLoaded, items: items));\n   } else {\n    emit(state.copyWith(error: &#039;No stock items found matching criteria.&#039;, status: FormEditorStatus.error));\n   }\n  } catch (e){\n  emit(state.copyWith(error: e.toString(), status: FormEditorStatus.error));\n  }\n } else {\n  emit(state.copyWith(error: &#039;Error - Search Name can&#039;t be blank&#039;, status: FormEditorStatus.error));\n }\n}\n<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Check to make sure that the name field is not empty.  If it is, then we can&#8217;t search for a stock item as name is a required field.<\/li>\n\n\n<li>Call the repository to search for stock items.  The repository will use the Query API to search for stock items.<\/li>\n\n\n<li>If the search returns a list of stock items, then emit the state with the list of stock items.<\/li>\n\n\n<li>If not, then emit the state with an error message.<\/li>\n\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/github.com\/couchbase-examples\/flutter_cbl_learning_path\/blob\/main\/src\/lib\/features\/audit\/data\/stock_item_repository.dart#L38\"> <strong>stock_item_repository.dart<\/strong><\/a> file and locate the <code>search<\/code> method.<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-dart\"><code>Future&lt;List&lt;StockItem&gt;&gt; search(\n String? searchName,\n String? searchDescription) async {\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>This method does not use live query, so we return a List of StockItem objects.<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-dart\"><code>List&lt;StockItem&gt; items = [];\n try {\n  if (searchName != null) {\n   var db = _databaseProvider.warehouseDatabase;\n   if (db != null) {\n   \/\/ &lt;1&gt;\n    var queryString = &#039;SELECT * FROM _ AS item WHERE documentType=&quot;$documentType&quot; AND lower($nameAttributeName) LIKE (&#039;%&#039; || $parameterName || &#039;%&#039;)&#039;;\n    \/\/ &lt;2&gt;\n    var parameters = Parameters();\n    \/\/ &lt;3&gt;\n    parameters.setString(searchName.toLowerCase(), name: &#039;parameterName&#039;);\n    \/\/ &lt;4&gt;\n    if (searchDescription != null &amp;&amp; searchDescription.isNotEmpty){\n     queryString = &#039;$queryString AND lower($descriptionAttributeName) LIKE (&#039;%&#039; || $parameterDescription || &#039;%&#039;)&#039;;\n     parameters.setString(searchDescription, name: &#039;parameterDescription&#039;);\n    }\n    \/\/ &lt;5&gt;\n    var query = await AsyncQuery.fromN1ql(db, queryString);\n    \/\/ &lt;6&gt;\n    query.setParameters(parameters);\n    \/\/ &lt;7&gt;\n    var result = await query.execute();\n    var results = await result.allResults();\n    \/\/ &lt;8&gt;\n    for(var r in results){\n     var map = r.toPlainMap();\n     var stockItemDoa = StockItemDao.fromJson(map);\n     items.add(stockItemDoa.item);\n   }\n  }\n }\n} catch (e){\n  debugPrint(e.toString());\n}\nreturn items;\n<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Create a query string using SQL++ syntax.  Notice the like statement % must be escaped charactered with a backslash.<\/li>\n\n\n<li>Create a parameters object.<\/li>\n\n\n<li>Add the searchName parameter to the parameters object.<\/li>\n\n\n<li>Check the search description to see if it has a value in it.  If it does add it to the query string and parameters object.<\/li>\n\n\n<li>Query using the AsyncQuery class using the fromN1ql method.<\/li>\n\n\n<li>Set the parameters on the query object.<\/li>\n\n\n<li>Execute the query and get the results.<\/li>\n\n\n<li>Loop through the results and add them to the list of StockItem objects.<\/li>\n\n<\/ol>\n\n\n\n<h3 id=\"h-learn-more\" class=\"wp-block-heading\">Learn More<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Congratulations on completing this step of our learning path!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This step of the learning path walked you through the SQL++ Query API in Couchbase Lite and used it to return documents from the database using serveral methods. Check out the following links for further documenation and continue on to the next step.<\/p>\n\n\n\n<h4 id=\"h-references\" class=\"wp-block-heading\">References<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/docs.couchbase.com\/couchbase-lite\/current\/android\/query-n1ql-mobile.html\">Documentation: SQL++ Query Strings<\/a><\/li>\n\n\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/docs.couchbase.com\/couchbase-lite\/current\/android\/query-n1ql-mobile.html#purpose-21\">Documentation: SQL++ Query Strings &#8211; Comparision Operators<\/a><\/li>\n\n\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/docs.couchbase.com\/couchbase-lite\/current\/android\/query-n1ql-mobile.html#lbl-functions\">Documentation: SQL++ Query Strings &#8211; Functions<\/a><\/li>\n\n\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/docs.couchbase.com\/couchbase-lite\/current\/android\/query-n1ql-mobile-server-diffs.html\">Documentation: SQL++ Differences<\/a><\/li>\n\n\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/docs.couchbase.com\/couchbase-lite\/current\/android\/query-resultsets.html\">Documentation: Result Sets<\/a><\/li>\n\n\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/docs.couchbase.com\/couchbase-lite\/current\/android\/query-live.html\">Documentation: Live Query &#8211; Working with Queries<\/a><\/li>\n\n\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/docs.couchbase.com\/couchbase-lite\/current\/android\/query-troubleshooting.html\">Documentation: Query Troubleshooting\n<\/a><\/li>\n\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Couchbase Mobile supports SQL++ query strings using the SQL++ Query API. SQL++ is Couchbase\u2019s declarative query language that extends SQL for JSON. The structure and semantics of the query format are based on that of Couchbase Server\u2019s SQL++ query language\u2009\u2014\u2009see N1QL Reference Guide and N1QL Data Model. In this step of the learning path [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"menu_order":0,"template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"_acf":"","footnotes":""},"tutorial-languages":[589],"tutorial-tags":[587,591,590],"tutorial-technologies":[585],"tutorial-types":[555],"class_list":["post-10253","tutorials","type-tutorials","status-publish","hentry","tutorial-languages-dart","tutorial-tags-android","tutorial-tags-flutter","tutorial-tags-ios","tutorial-technologies-mobile","tutorial-types-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.8 (Yoast SEO v28.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Learn Couchbase Lite SQL++ Querying with Dart and Flutter - Couchbase<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/dart-flutter-query-sql\/\" \/>\n<meta property=\"og:locale\" content=\"it_IT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Learn Couchbase Lite SQL++ Querying with Dart and Flutter\" \/>\n<meta property=\"og:description\" content=\"Introduction Couchbase Mobile supports SQL++ query strings using the SQL++ Query API. SQL++ is Couchbase\u2019s declarative query language that extends SQL for JSON. The structure and semantics of the query format are based on that of Couchbase Server\u2019s SQL++ query language\u2009\u2014\u2009see N1QL Reference Guide and N1QL Data Model. In this step of the learning path [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/dart-flutter-query-sql\/\" \/>\n<meta property=\"og:site_name\" content=\"Couchbase\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Couchbase\/\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/10\/Cloud-2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2548\" \/>\n\t<meta property=\"og:image:height\" content=\"1171\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@couchbase\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"14 minuti\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/developers\\\/tutorials\\\/dart-flutter-query-sql\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/developers\\\/tutorials\\\/dart-flutter-query-sql\\\/\",\"name\":\"Learn Couchbase Lite SQL++ Querying with Dart and Flutter - Couchbase\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/#website\"},\"datePublished\":\"2023-06-23T08:43:43+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/developers\\\/tutorials\\\/dart-flutter-query-sql\\\/#breadcrumb\"},\"inLanguage\":\"it-IT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/it\\\/developers\\\/tutorials\\\/dart-flutter-query-sql\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/developers\\\/tutorials\\\/dart-flutter-query-sql\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.couchbase.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Learn Couchbase Lite SQL++ Querying with Dart and Flutter\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/#website\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/\",\"name\":\"Couchbase\",\"description\":\"The Operational Data Platform for AI\u2122\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/#organization\"},\"alternateName\":\"Couchbase, Inc.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"it-IT\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/#organization\",\"name\":\"Couchbase\",\"alternateName\":\"Couchbase, Inc.\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/Couchbase_Logo_Couchbase_Token_Red-1.png\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/Couchbase_Logo_Couchbase_Token_Red-1.png\",\"width\":1129,\"height\":1129,\"caption\":\"Couchbase\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Couchbase\\\/\",\"https:\\\/\\\/x.com\\\/couchbase\",\"https:\\\/\\\/www.youtube.com\\\/c\\\/CouchbaseServer\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/couchbase\\\/\",\"https:\\\/\\\/github.com\\\/couchbase\\\/\",\"https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/Couchbase,_Inc.\"],\"description\":\"Couchbase is a database software company headquartered in San Jose, California, providing an operational data platform for AI used by hundreds of global enterprises.\",\"legalName\":\"Couchbase, Inc.\",\"foundingDate\":\"2011-01-01\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Learn Couchbase Lite SQL++ Querying with Dart and Flutter - Couchbase","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/dart-flutter-query-sql\/","og_locale":"it_IT","og_type":"article","og_title":"Learn Couchbase Lite SQL++ Querying with Dart and Flutter","og_description":"Introduction Couchbase Mobile supports SQL++ query strings using the SQL++ Query API. SQL++ is Couchbase\u2019s declarative query language that extends SQL for JSON. The structure and semantics of the query format are based on that of Couchbase Server\u2019s SQL++ query language\u2009\u2014\u2009see N1QL Reference Guide and N1QL Data Model. In this step of the learning path [&hellip;]","og_url":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/dart-flutter-query-sql\/","og_site_name":"Couchbase","article_publisher":"https:\/\/www.facebook.com\/Couchbase\/","og_image":[{"width":2548,"height":1171,"url":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/10\/Cloud-2.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@couchbase","twitter_misc":{"Est. reading time":"14 minuti"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/dart-flutter-query-sql\/","url":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/dart-flutter-query-sql\/","name":"Learn Couchbase Lite SQL++ Querying with Dart and Flutter - Couchbase","isPartOf":{"@id":"https:\/\/www.couchbase.com\/it\/#website"},"datePublished":"2023-06-23T08:43:43+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/dart-flutter-query-sql\/#breadcrumb"},"inLanguage":"it-IT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/it\/developers\/tutorials\/dart-flutter-query-sql\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/dart-flutter-query-sql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/"},{"@type":"ListItem","position":2,"name":"Learn Couchbase Lite SQL++ Querying with Dart and Flutter"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/it\/#website","url":"https:\/\/www.couchbase.com\/it\/","name":"Couchbase","description":"The Operational Data Platform for AI\u2122","publisher":{"@id":"https:\/\/www.couchbase.com\/it\/#organization"},"alternateName":"Couchbase, Inc.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/it\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"it-IT"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/it\/#organization","name":"Couchbase","alternateName":"Couchbase, Inc.","url":"https:\/\/www.couchbase.com\/it\/","logo":{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/www.couchbase.com\/it\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/11\/Couchbase_Logo_Couchbase_Token_Red-1.png","contentUrl":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/11\/Couchbase_Logo_Couchbase_Token_Red-1.png","width":1129,"height":1129,"caption":"Couchbase"},"image":{"@id":"https:\/\/www.couchbase.com\/it\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Couchbase\/","https:\/\/x.com\/couchbase","https:\/\/www.youtube.com\/c\/CouchbaseServer","https:\/\/www.linkedin.com\/company\/couchbase\/","https:\/\/github.com\/couchbase\/","https:\/\/en.wikipedia.org\/wiki\/Couchbase,_Inc."],"description":"Couchbase \u00e8 una societ\u00e0 di software per database con sede a San Jose, in California, che fornisce una piattaforma operativa per i dati utilizzata da centinaia di aziende globali.","legalName":"Couchbase, Inc.","foundingDate":"2011-01-01"}]}},"acf":[],"permalink_manager":null,"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorials\/10253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorials"}],"about":[{"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/types\/tutorials"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorials\/10253\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/media?parent=10253"}],"wp:term":[{"taxonomy":"tutorial-languages","embeddable":true,"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorial-languages?post=10253"},{"taxonomy":"tutorial-tags","embeddable":true,"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorial-tags?post=10253"},{"taxonomy":"tutorial-technologies","embeddable":true,"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorial-technologies?post=10253"},{"taxonomy":"tutorial-types","embeddable":true,"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorial-types?post=10253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}