Skip to content

Commit ad32aa9

Browse files
authored
(DOCSP-39514): Consolidate Read page (#3357)
## Pull Request Info - SDK Docs Consolidation Jira ticket: https://jira.mongodb.org/browse/DOCSP-39514 *Staged Page* - [Read](https://preview-mongodbdacharyc.gatsbyjs.io/realm/DOCSP-39514/sdk/crud/read/) - [Read Properties](https://preview-mongodbdacharyc.gatsbyjs.io/realm/DOCSP-39514/sdk/crud/read/read-properties/) - [Fluent Interface (Java SDK)](https://preview-mongodbdacharyc.gatsbyjs.io/realm/DOCSP-39514/sdk/crud/query-engines/filter-data-java-sdk/): Port content, update Realm naming, and change to use the Drivers tab languages so it preserves a language selection when clicking into the page - [LINQ (.NET SDK)](https://preview-mongodbdacharyc.gatsbyjs.io/realm/DOCSP-39514/sdk/crud/query-engines/filter-data-linq/): Port LINQ content, update Realm naming, omit stuff about querying with RQL as that is generally surfaced in the C# API descriptions on the Read page *Page Source* Add links to every SDK's pages where you got the SDK-specific information: - [C++: Read](https://www.mongodb.com/docs/atlas/device-sdks/sdk/cpp/crud/read/) - [Flutter: Read](https://www.mongodb.com/docs/atlas/device-sdks/sdk/flutter/crud/read/) - [Flutter: Model Data/Results](https://www.mongodb.com/docs/atlas/device-sdks/sdk/flutter/realm-database/model-data/data-types/#realmresults) - [Flutter: Model Data/Geospatial Data](https://www.mongodb.com/docs/atlas/device-sdks/sdk/flutter/realm-database/model-data/geospatial/) - [Java: Read](https://www.mongodb.com/docs/atlas/device-sdks/sdk/java/crud/read/) - [Java: Filter Data](https://www.mongodb.com/docs/atlas/device-sdks/sdk/java/crud/filter-data/) - [Java: Model Data/Results](https://www.mongodb.com/docs/atlas/device-sdks/sdk/java/model-data/data-types/collections/#results-collections) - [Java: Data Types/Mixed (Queries)](https://www.mongodb.com/docs/atlas/device-sdks/sdk/java/model-data/data-types/realmany/#queries) - [Kotlin: Read](https://www.mongodb.com/docs/atlas/device-sdks/sdk/kotlin/realm-database/crud/read/) - [Kotlin: Model Data/Geospatial Data](https://www.mongodb.com/docs/atlas/device-sdks/sdk/kotlin/realm-database/schemas/geospatials/) - [.NET: Read](https://www.mongodb.com/docs/atlas/device-sdks/sdk/dotnet/crud/read/) - [.NET: Filter Data](https://www.mongodb.com/docs/atlas/device-sdks/sdk/dotnet/crud/filter/) - [.NET: Results Collections](https://www.mongodb.com/docs/atlas/device-sdks/sdk/dotnet/model-data/data-types/collections/) - [.NET: Geospatial Data](https://www.mongodb.com/docs/atlas/device-sdks/sdk/dotnet/model-data/data-types/geospatials/) - [Node.js: Read](https://www.mongodb.com/docs/atlas/device-sdks/sdk/node/crud/read/) - [Node.js: Collections (info about Results)](https://www.mongodb.com/docs/atlas/device-sdks/sdk/node/model-data/data-types/collections/) - [Node.js: Relationships (Inverse relationship info](https://www.mongodb.com/docs/atlas/device-sdks/sdk/node/model-data/relationships-and-embedded-objects/) - [Node.js: Data Types/Dictionaries (Query)](https://www.mongodb.com/docs/atlas/device-sdks/sdk/node/model-data/data-types/dictionaries/#query-for-objects-with-a-dictionary-property) - [Node.js: Data Types/Sets (info relevant to reading set properties)](https://www.mongodb.com/docs/atlas/device-sdks/sdk/node/model-data/data-types/sets/) - [Node.js: Data Types/Mixed (Query)](https://www.mongodb.com/docs/atlas/device-sdks/sdk/node/model-data/data-types/mixed/#query-for-objects-with-a-mixed-value) - [Node.js: Data Types/Geospatial (Query)](https://www.mongodb.com/docs/atlas/device-sdks/sdk/node/model-data/data-types/geospatial/#query-geospatial-data) - [Swift: Read](https://www.mongodb.com/docs/atlas/device-sdks/sdk/swift/crud/read/) - [Swift: Supported Types: Results & Sectioned Results](https://www.mongodb.com/docs/atlas/device-sdks/sdk/swift/model-data/supported-types/#results-and-sectioned-results) ### PR Author Checklist Before requesting a review for your PR, please check these items: - [x] Open the PR against the `feature-consolidated-sdk-docs` branch instead of `master` - [x] Tag the consolidated page for: - genre - meta.keywords - meta.description #### Naming - [x] Update Realm naming and the language around persistence layer/local/device per [this document](https://docs.google.com/document/d/126OczVxBWAwZ4P5ZsSM29WI3REvONEr1ald-mAwPtyQ/edit?usp=sharing) - [x] Include `.rst` files comply with [the naming guidelines](https://docs.google.com/document/d/1h8cr66zoEVeXytVfvDxlCSsUS5IZwvUQvfSCEXNMpek/edit#heading=h.ulh8b5f2hu9) #### Links and Refs - [x] Create new consolidated SDK ref targets starting with "_sdks-" for relevant sections - [x] Remove or update any SDK-specific refs to use the new consolidated SDK ref targets - [x] [Update any Kotlin API links](https://jira.mongodb.org/browse/DOCSP-32519) to use the new Kotlin SDK roles #### Content - [x] Shared code boxes have snippets or placeholders for all 9 languages - [x] API description sections have API details or a generic placeholder for all 9 languages - [x] Check related pages for relevant content to include - [x] Create a ticket for missing examples in each relevant SDK: Consolidation Gaps epic ### Reviewer Checklist As a reviewer, please check these items: - [ ] Shared code example boxes contain language-specific snippets or placeholders for every language - [ ] API reference details contain working API reference links or generic content - [ ] Realm naming/language has been updated - [ ] All relevant content from individual SDK pages is present on the consolidated page
1 parent ccb45ee commit ad32aa9

File tree

216 files changed

+6508
-55
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

216 files changed

+6508
-55
lines changed

snooty.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ intersphinx = [
1111
toc_landing_pages = [
1212
# New IA
1313
"/sdk/crud/create",
14+
"/sdk/crud/read",
1415
"/sdk/platforms/android",
1516
"/sdk/platforms/apple",
1617
"/sdk/platforms/unity",
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
In C++, the :cpp-sdk:`Results <structrealm_1_1results.html>` type exposes member
2+
functions to work with results. You may want to check the ``.size()`` of a
3+
results set, or access the object at a specific index.
4+
5+
Additionally, you can iterate through the results, or observe a results
6+
set for changes. For more details about observing the results for changes,
7+
refer to :ref:`sdks-react-to-changes`.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
C++ does not currently support aggregate operators.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
To query for objects of a given type in the database, pass the object type
2+
``YourClassName`` to the :cpp-sdk:`db::objects\<T\> <structrealm_1_1db.html>`
3+
member function.
4+
5+
This returns a :cpp-sdk:`Results <structrealm_1_1results.html>` object
6+
representing all objects of the given type in the database.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
To find objects stored within a database:
2+
3+
1. Query for objects of a given type in the database, pass the object type
4+
``YourClassName`` to the :cpp-sdk:`db::objects <structrealm_1_1db.html>`
5+
member function.
6+
7+
#. Optionally, pass any query conditions to further refine the results:
8+
9+
- Specify a filter to only return objects that meet the condition. If
10+
you don't specify a filter, the SDK returns all objects of the specified
11+
type.
12+
13+
- Specify the sort order for the results.
14+
Because the database is unordered, if you don't include a sort order,
15+
the SDK cannot guarantee the query returns objects in any specific order.
16+
17+
#. Work with the results. Objects may be frozen or live, depending on whether
18+
you queried a frozen or live database, collection, or object.
19+
20+
Note that any retrieved results don't actually hold matching database objects
21+
in memory. Instead, the database uses **direct references**, or pointers.
22+
Database objects in a results collection reference the matched objects, which
23+
map directly to data in the database file. This also means that you can
24+
traverse your graph of an object's :ref:`relationships <sdks-relationships>`
25+
directly through the results of a query.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
To filter data, call the ``.where()`` function on a collection with a valid
2+
query. Currently, C++ supports only a subset of RQL operators.
3+
4+
Supported Query Operators
5+
`````````````````````````
6+
7+
C++ supports the following query operators:
8+
9+
- Equality (``==``, ``!=``)
10+
- Greater than/less than (``>``, ``>=``, ``<``, ``<=``)
11+
- Compound queries (``||``, ``&&``)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
C++ does not provide a dedicated API to find an object by its primary
2+
key. Instead, you can perform a regular query for objects where the primary
3+
key property matches the desired primary key value.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Query operationsn return a :cpp-sdk:`results collection
2+
<structrealm_1_1results.html>`. Results collections may be either live or
3+
frozen.
4+
5+
- **Live results** always contain the latest results of the associated query.
6+
- **Frozen results** represent a snapshot that cannot be modified and doesn't
7+
reflect the latest changes to the database.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
C++ does not provide an API to limit query results. Instead, rely on the
2+
SDK's lazy loading characteristics to implicitly limit the objects in
3+
memory by only accessing the objects you need for an operation.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
You can iterate and check the values of a realm :cpp-sdk:`map property
2+
<structrealm_1_1managed_3_01std_1_1map_3_01std_1_1string_00_01T_01_4_00_01void_01_4.html>`
3+
as you would a standard C++ `map <https://en.cppreference.com/w/cpp/container/map>`__.

0 commit comments

Comments
 (0)