Skip to content

Commit

Permalink
Merge pull request #1879 from reebhub/Python_DocExt3_TS_v2
Browse files Browse the repository at this point in the history
[Python] Document-extensions pages batch - Time series [Replace C# samples]
  • Loading branch information
ppekrol committed Aug 21, 2024
2 parents ded2f49 + de8f155 commit e0d55b8
Show file tree
Hide file tree
Showing 49 changed files with 4,154 additions and 839 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

* Queries in RavenDB can be written with either of the following:
* Using a rich API via session's `query` method
* Using a low-level API via session's `document_query` method
* Using the [document_query](../../../client-api/session/querying/document-query/query-vs-document-query) method
* Using **RQL** -
- when querying via session's `raw_query` method
- when querying through Studio's [Query view](../../../studio/database/queries/query-view)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,42 +46,32 @@

{PANEL: Examples}

{NOTE: }
<a id="append-single-entry" /> __Append single entry__:
#### Append single entry:

---
In this example, we append a single entry with a single value to time series "HeartRates".
{CODE timeseries_region_Use-BulkInsert-To-Append-single-entry@DocumentExtensions\TimeSeries\TimeSeriesTests.cs /}

{NOTE/}
---

{NOTE: }
<a id="append-multiple-entries" /> __Append multiple entries__:
#### Append multiple entries:

---
In this example, we append 100 entries with a single value to time series "HeartRates".
{CODE timeseries_region_Use-BulkInsert-To-Append-100-Entries@DocumentExtensions\TimeSeries\TimeSeriesTests.cs /}

{NOTE/}
---

{NOTE: }
<a id="append-multiple-values-per-entry" /> __Append multiple values per entry__:
#### Append multiple values per entry:

---
In this example, we append multiple values per entry in time series "HeartRates".
{CODE BulkInsert-overload-2-Two-HeartRate-Sets@DocumentExtensions\TimeSeries\TimeSeriesTests.cs /}

{NOTE/}
---

{NOTE: }
<a id="append-multiple-time-series" /> __Append multiple time series__:
#### Append multiple time series:

---
In this example, we append multiple time series in different documents in the same batch.
{CODE timeseries_region_Use-BulkInsert-To-Append-multiple-timeseries@DocumentExtensions\TimeSeries\TimeSeriesTests.cs /}

{NOTE/}

{PANEL/}

{PANEL: Syntax}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,42 +46,32 @@

{PANEL: Examples}

{NOTE: }
<a id="append-single-entry" /> __Append single entry__:
#### Append single entry:

---
In this example, we append a single entry with a single value to time series "HeartRates".
{CODE:nodejs append_1@documentExtensions\timeSeries\client-api\appendWithBulkInsert.js /}

{NOTE/}
---

{NOTE: }
<a id="append-multiple-entries" /> __Append multiple entries__:
#### Append multiple entries:

---
In this example, we append 100 entries with a single value to time series "HeartRates".
{CODE:nodejs append_2@documentExtensions\timeSeries\client-api\appendWithBulkInsert.js /}

{NOTE/}
---

{NOTE: }
<a id="append-multiple-values-per-entry" /> __Append multiple values per entry__:
#### Append multiple values per entry:

---
In this example, we append multiple values per entry in time series "HeartRates".
{CODE:nodejs append_3@documentExtensions\timeSeries\client-api\appendWithBulkInsert.js /}

{NOTE/}
---

{NOTE: }
<a id="append-multiple-time-series" /> __Append multiple time series__:
#### Append multiple time series:

---
In this example, we append multiple time series in different documents in the same batch.
{CODE:nodejs append_4@documentExtensions\timeSeries\client-api\appendWithBulkInsert.js /}

{NOTE/}

{PANEL/}

{PANEL: Syntax}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,22 +97,14 @@ Values are returned in an array of time series entries, i.e. -

{PANEL: Examples}

{NOTE: }

This example shows a script that appends 100 entries to time series "HeartRates" in document "Users/john".
The script is passed to method [session.Advanced.Defer](../../../document-extensions/timeseries/client-api/session/patch).
* This example shows a script that appends 100 entries to time series "HeartRates" in document "Users/john".
The script is passed to method [session.Advanced.Defer](../../../document-extensions/timeseries/client-api/session/patch).
{CODE TS_region-Session_Patch-Append-TS-Entries@DocumentExtensions\TimeSeries\TimeSeriesTests.cs /}

{CODE TS_region-Session_Patch-Append-TS-Entries@DocumentExtensions\TimeSeries\TimeSeriesTests.cs /}
* This example shows a script that deletes time series "HeartRates" for documents that match the specified query.
The script is passed to the [PatchByQueryOperation](../../../document-extensions/timeseries/client-api/operations/patch#patchbyqueryoperation) operation.
{CODE TS_region-PatchByQueryOperation-Delete-From-Multiple-Docs@DocumentExtensions\TimeSeries\TimeSeriesTests.cs /}

{NOTE/}
{NOTE: }

This example shows a script that deletes time series "HeartRates" for documents that match the specified query.
The script is passed to the [PatchByQueryOperation](../../../document-extensions/timeseries/client-api/operations/patch#patchbyqueryoperation) operation.

{CODE TS_region-PatchByQueryOperation-Delete-From-Multiple-Docs@DocumentExtensions\TimeSeries\TimeSeriesTests.cs /}

{NOTE/}
{PANEL/}

## Related articles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,22 +97,14 @@ Values are returned in an array of time series entries, i.e. -

{PANEL: Examples}

{NOTE: }

This example shows a script that appends 100 entries to time series "HeartRates" in document "Users/john".
The script is passed to method [session.Advanced.Defer](../../../document-extensions/timeseries/client-api/session/patch).
* This example shows a script that appends 100 entries to time series "HeartRates" in document "Users/john".
The script is passed to method [session.Advanced.Defer](../../../document-extensions/timeseries/client-api/session/patch).
{CODE:nodejs js_support_1@documentExtensions\timeSeries\client-api\javascriptSupport.js /}

{CODE:nodejs js_support_1@documentExtensions\timeSeries\client-api\javascriptSupport.js /}
* This example shows a script that deletes time series "HeartRates" for documents that match the specified query.
The script is passed to the [PatchByQueryOperation](../../../document-extensions/timeseries/client-api/operations/patch#patchbyqueryoperation) operation.
{CODE:nodejs js_support_2@documentExtensions\timeSeries\client-api\javascriptSupport.js /}

{NOTE/}
{NOTE: }

This example shows a script that deletes time series "HeartRates" for documents that match the specified query.
The script is passed to the [PatchByQueryOperation](../../../document-extensions/timeseries/client-api/operations/patch#patchbyqueryoperation) operation.

{CODE:nodejs js_support_2@documentExtensions\timeSeries\client-api\javascriptSupport.js /}

{NOTE/}
{PANEL/}

## Related articles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,15 @@ public void Deconstruct(out DateTime timestamp, out T value, out string tag);

#### Examples

{NOTE: }

In this example, we define a StockPrice type and use it when appending StockPrice entries.

{CODE Custom-Data-Type-1@DocumentExtensions\TimeSeries\TimeSeriesTests.cs /}

{CODE timeseries_region_Append-Named-Values-2@DocumentExtensions\TimeSeries\TimeSeriesTests.cs /}

{NOTE/}
{NOTE: }
* In this example, we define a StockPrice type and use it when appending StockPrice entries.
{CODE Custom-Data-Type-1@DocumentExtensions\TimeSeries\TimeSeriesTests.cs /}
{CODE timeseries_region_Append-Named-Values-2@DocumentExtensions\TimeSeries\TimeSeriesTests.cs /}

In this example, we get StockPrice values by name and check whether a stock's closing-time prices are ascending over time.
* In this example, we get StockPrice values by name and check whether a stock's closing-time prices are ascending over time.
{CODE timeseries_region_Get-Named-Values@DocumentExtensions\TimeSeries\TimeSeriesTests.cs /}

{CODE timeseries_region_Get-Named-Values@DocumentExtensions\TimeSeries\TimeSeriesTests.cs /}

{NOTE/}
{NOTE: }

In this query, we use the custom StockPrice type so we can address trade Volume by name.

{CODE-TABS}
* In this query, we use the custom StockPrice type so we can address trade Volume by name.
{CODE-TABS}
{CODE-TAB:csharp:Query timeseries_region_Named-Values-Query@DocumentExtensions\TimeSeries\TimeSeriesTests.cs /}
{CODE-TAB-BLOCK:sql:RQL}
from "companies" as c
Expand All @@ -99,7 +87,6 @@ select timeseries(
{CODE-TAB-BLOCK/}
{CODE-TABS/}

{NOTE/}
{PANEL/}

{PANEL: Register time series type}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,15 @@ The class can then be used by time series methods like _append_:

#### Examples

{NOTE: }

In this example, we define a StockPrice class and use it when appending StockPrice entries.

{CODE:nodejs stockPrice_class@documentExtensions\timeSeries\client-api\namedValues.js /}

{CODE:nodejs named_values_2@documentExtensions\timeSeries\client-api\namedValues.js /}

{NOTE/}
{NOTE: }
* In this example, we define a StockPrice class and use it when appending StockPrice entries.
{CODE:nodejs stockPrice_class@documentExtensions\timeSeries\client-api\namedValues.js /}
{CODE:nodejs named_values_2@documentExtensions\timeSeries\client-api\namedValues.js /}

In this example, we get StockPrice values by name and check whether a stock's closing-time prices are ascending over time.
* In this example, we get StockPrice values by name and check whether a stock's closing-time prices are ascending over time.
{CODE:nodejs named_values_3@documentExtensions\timeSeries\client-api\namedValues.js /}

{CODE:nodejs named_values_3@documentExtensions\timeSeries\client-api\namedValues.js /}

{NOTE/}
{NOTE: }

In this query, we use the custom StockPrice type so we can address trade Volume by name.

{CODE-TABS}
* In this query, we use the custom StockPrice type so we can address trade Volume by name.
{CODE-TABS}
{CODE-TAB:nodejs:Query named_values_4@documentExtensions\timeSeries\client-api\namedValues.js /}
{CODE-TAB-BLOCK:sql:RQL}
from "companies"
Expand All @@ -87,7 +75,6 @@ select timeseries(
{CODE-TAB-BLOCK/}
{CODE-TABS/}

{NOTE/}
{PANEL/}

{PANEL: Register time series named values}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,38 +48,30 @@

{PANEL: Examples}

{NOTE: }

#### Append multiple entries
#### Append multiple entries:

In this example, we append four entries to a time series.

{CODE timeseries_region_Append-Using-TimeSeriesBatchOperation@DocumentExtensions\TimeSeries\TimeSeriesTests.cs /}

{NOTE/}

{NOTE: }
---

#### Delete multiple entries
#### Delete multiple entries:

In this example, we delete a range of two entries from a time series.

{CODE timeseries_region_Delete-Range-Using-TimeSeriesBatchOperation@DocumentExtensions\TimeSeries\TimeSeriesTests.cs /}

{NOTE/}

{NOTE: }
---

#### Append & Delete entries in the same batch
#### Append & Delete entries in the same batch:

* In this example, we append and delete entries in the same batch operation.

* Note: the Delete actions are executed **before** all Append actions.

{CODE timeseries_region-Append-and-Delete-TimeSeriesBatchOperation@DocumentExtensions\TimeSeries\TimeSeriesTests.cs /}

{NOTE/}

{PANEL/}

{PANEL: Syntax}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,37 +48,30 @@

{PANEL: Examples}

{NOTE: }

#### Append multiple entries
#### Append multiple entries:

In this example, we append four entries to a time series.

{CODE:nodejs operation_1@documentExtensions\timeSeries\client-api\appendAndDeleteOperations.js /}

{NOTE/}

{NOTE: }
---

#### Delete multiple entries
#### Delete multiple entries:

In this example, we delete a range of two entries from a time series.

{CODE:nodejs operation_2@documentExtensions\timeSeries\client-api\appendAndDeleteOperations.js /}

{NOTE/}

{NOTE: }
---

#### Append & delete entries in the same batch
#### Append & delete entries in the same batch:

* In this example, we append and delete entries in the same batch operation.

* Note: the Delete actions are executed **before** all Append actions.

{CODE:nodejs operation_3@documentExtensions\timeSeries\client-api\appendAndDeleteOperations.js /}

{NOTE/}
{PANEL/}

{PANEL: Syntax}
Expand Down
Loading

0 comments on commit e0d55b8

Please sign in to comment.