forked from couchbase/docs-couchbase-lite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DOC-8064-C2 -- JSON Results (post-feedback) (couchbase#488)
- Loading branch information
Showing
8 changed files
with
32 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 24 additions & 6 deletions
30
modules/ROOT/pages/_partials/commons/common-querybuilder-jsonresult.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,34 @@ | ||
// Inclusion block | ||
[#ex-json] | ||
.Using JSON Results | ||
|
||
.Caption | ||
[#label] | ||
:param-tags: query-access-json | ||
:param-leader: pass:q,a[Use {url-api-method-result-toJSON} to transform your result string into a JSON string, which can easily be serialized or used as required in your application. See <<ex-json>> for a working example.] | ||
include::{root-partials}_block_tabbed_code_example.adoc[] | ||
:param-tags!: | ||
<.> Get the Query result as a JSON string -- this example assumes your query SELECTed specific properties. | ||
<.> Get the Query result as a JSON string -- this example assumes your query SELECTed ALL | ||
<.> Get the Query result as a JSON string -- see <<ex-json-format>> | ||
<.> Get a native object from the JSON string | ||
<.> Populate your custom object from the dictionary created from JSON data | ||
|
||
// end inclusion block | ||
.JSON String Format | ||
[#ex-json-format] | ||
If your query selects ALL then the JSON format will be: | ||
|
||
[source, JSON] | ||
---- | ||
{ | ||
database-name: { | ||
key1: "value1", | ||
keyx: "valuex" | ||
} | ||
} | ||
---- | ||
|
||
If your query selects a sub-set of available properties then the JSON format will be: | ||
|
||
[source, JSON] | ||
---- | ||
{ | ||
key1: "value1", | ||
keyx: "valuex" | ||
} | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters