Skip to content

Commit 12b7bd0

Browse files
authored
Merge pull request #2020 from Danielle9897/RDoc-1999-atomicGuardNotDeleted
RDoc-1999 When deleting documents by query, the associated atomic guards are not deleted
2 parents 6c4b7a6 + 475fe05 commit 12b7bd0

File tree

16 files changed

+1001
-538
lines changed

16 files changed

+1001
-538
lines changed

Documentation/5.4/Raven.Documentation.Pages/client-api/operations/common/delete-by-query.dotnet.markdown

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,21 @@
1212

1313
* **Background operation**:
1414
This operation is performed in the background on the server.
15-
If needed, you can **wait** for the operation to complete. See: [Wait for completion](../../../client-api/operations/what-are-operations#wait-for-completion).
15+
If needed, you can wait for the operation to complete. See: [Wait for completion](../../../client-api/operations/what-are-operations#wait-for-completion).
1616

17-
* In this page:
17+
* **Operation scope**:
18+
`DeleteByQueryOperation` runs as a single-node transaction, not a cluster-wide transaction. As a result,
19+
if you use this operation to delete documents that were originally created using a cluster-wide transaction,
20+
their associated [Atomic guards](../../../client-api/session/cluster-transaction/atomic-guards) will Not be deleted.
21+
22+
* To avoid issues when recreating such documents using a cluster-wide session,
23+
see [Best practice when storing a document](../../../client-api/session/cluster-transaction/atomic-guards#best-practice-when-storing-a-document-in-a-cluster-wide-transaction).
24+
* To learn more about the differences between transaction types,
25+
see [Cluster-wide transaction vs. Single-node transaction](../../../client-api/session/cluster-transaction/overview#cluster-wide-transaction-vs.-single-node-transaction).
26+
27+
---
28+
29+
* In this article:
1830
* [Delete by dynamic query](../../../client-api/operations/common/delete-by-query#delete-by-dynamic-query)
1931
* [Delete by index query](../../../client-api/operations/common/delete-by-query#delete-by-index-query)
2032
* [Syntax](../../../client-api/operations/common/delete-by-query#syntax)
@@ -23,28 +35,32 @@
2335

2436
{PANEL: Delete by dynamic query}
2537

26-
#### Delete all documents in a collection:
38+
{CONTENT-FRAME: }
39+
40+
##### Delete all documents in a collection
2741

2842
{CODE-TABS}
29-
{CODE-TAB:csharp:DeleteOperation_Sync delete_by_query_0@ClientApi\Operations\Common\DeleteByQuery.cs /}
30-
{CODE-TAB:csharp:DeleteOperation_Async delete_by_query_0_async@ClientApi\Operations\Common\DeleteByQuery.cs /}
43+
{CODE-TAB:csharp:DeleteByQueryOperation_Sync delete_by_query_0@ClientApi\Operations\Common\DeleteByQuery.cs /}
44+
{CODE-TAB:csharp:DeleteByQueryOperation_Async delete_by_query_0_async@ClientApi\Operations\Common\DeleteByQuery.cs /}
3145
{CODE-TAB-BLOCK:sql:RQL}
3246
from "Orders"
3347
{CODE-TAB-BLOCK/}
3448
{CODE-TABS/}
3549

36-
---
50+
{CONTENT-FRAME/}
51+
{CONTENT-FRAME: }
3752

38-
#### Delete with filtering:
53+
##### Delete with filtering
3954

4055
{CODE-TABS}
41-
{CODE-TAB:csharp:DeleteOperation_Sync delete_by_query_1@ClientApi\Operations\Common\DeleteByQuery.cs /}
42-
{CODE-TAB:csharp:DeleteOperation_Async delete_by_query_1_async@ClientApi\Operations\Common\DeleteByQuery.cs /}
56+
{CODE-TAB:csharp:DeleteByQueryOperation_Sync delete_by_query_1@ClientApi\Operations\Common\DeleteByQuery.cs /}
57+
{CODE-TAB:csharp:DeleteByQueryOperation_Async delete_by_query_1_async@ClientApi\Operations\Common\DeleteByQuery.cs /}
4358
{CODE-TAB-BLOCK:sql:RQL}
4459
from "Orders" where Freight > 30
4560
{CODE-TAB-BLOCK/}
4661
{CODE-TABS/}
4762

63+
{CONTENT-FRAME/}
4864
{PANEL/}
4965

5066
{PANEL: Delete by index query}
@@ -56,16 +72,19 @@ from "Orders" where Freight > 30
5672

5773
---
5874

59-
#### A sample Map-index:
75+
{CONTENT-FRAME: }
76+
77+
##### A sample Map-index
6078

6179
{CODE the_index@ClientApi\Operations\Common\DeleteByQuery.cs /}
6280

63-
---
81+
{CONTENT-FRAME/}
82+
{CONTENT-FRAME: }
6483

65-
#### Delete documents via an index query:
84+
##### Delete documents via an index query
6685

6786
{CODE-TABS}
68-
{CODE-TAB:csharp:DeleteOperation delete_by_query_2@ClientApi\Operations\Common\DeleteByQuery.cs /}
87+
{CODE-TAB:csharp:DeleteByQueryOperation delete_by_query_2@ClientApi\Operations\Common\DeleteByQuery.cs /}
6988
{CODE-TAB:csharp:Overload_1 delete_by_query_3@ClientApi\Operations\Common\DeleteByQuery.cs /}
7089
{CODE-TAB:csharp:Overload_2 delete_by_query_4@ClientApi\Operations\Common\DeleteByQuery.cs /}
7190
{CODE-TAB:csharp:Overload_3 delete_by_query_5@ClientApi\Operations\Common\DeleteByQuery.cs /}
@@ -74,26 +93,27 @@ from index "Products/ByPrice" where Price > 10
7493
{CODE-TAB-BLOCK/}
7594
{CODE-TABS/}
7695

77-
---
96+
{CONTENT-FRAME/}
97+
{CONTENT-FRAME: }
7898

79-
#### Delete with options:
99+
##### Delete with options
80100

81101
{CODE-TABS}
82-
{CODE-TAB:csharp:DeleteOperation delete_by_query_6@ClientApi\Operations\Common\DeleteByQuery.cs /}
83-
{CODE-TAB:csharp:DeleteOperation_async delete_by_query_6_async@ClientApi\Operations\Common\DeleteByQuery.cs /}
102+
{CODE-TAB:csharp:DeleteByQueryOperation delete_by_query_6@ClientApi\Operations\Common\DeleteByQuery.cs /}
103+
{CODE-TAB:csharp:DeleteByQueryOperation_async delete_by_query_6_async@ClientApi\Operations\Common\DeleteByQuery.cs /}
84104
{CODE-TAB-BLOCK:sql:RQL}
85105
from index "Products/ByPrice" where Price > 10
86106
{CODE-TAB-BLOCK/}
87107
{CODE-TABS/}
88108

89109
* Specifying `QueryOperationOptions` is also supported by the other overload methods, see the Syntax section below.
90110

111+
{CONTENT-FRAME/}
91112
{PANEL/}
92113

93114
{PANEL: Syntax}
94115

95116
{CODE syntax_1@ClientApi\Operations\Common\DeleteByQuery.cs /}
96-
<br />
97117

98118
| Parameter | Type | Description |
99119
|-------------------|-----------------------------|------------------------------------------------------------|

Documentation/5.4/Raven.Documentation.Pages/client-api/operations/common/delete-by-query.js.markdown

Lines changed: 39 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,21 @@
1212

1313
* **Background operation**:
1414
This operation is performed in the background on the server.
15-
If needed, you can **wait** for the operation to complete. See: [Wait for completion](../../../client-api/operations/what-are-operations#wait-for-completion).
15+
If needed, you can wait for the operation to complete. See: [Wait for completion](../../../client-api/operations/what-are-operations#wait-for-completion).
1616

17-
* In this page:
17+
* **Operation scope**:
18+
`DeleteByQueryOperation` runs as a single-node transaction, not a cluster-wide transaction. As a result,
19+
if you use this operation to delete documents that were originally created using a cluster-wide transaction,
20+
their associated [Atomic guards](../../../client-api/session/cluster-transaction/atomic-guards) will Not be deleted.
21+
22+
* To avoid issues when recreating such documents using a cluster-wide session,
23+
see [Best practice when storing a document](../../../client-api/session/cluster-transaction/atomic-guards#best-practice-when-storing-a-document-in-a-cluster-wide-transaction).
24+
* To learn more about the differences between transaction types,
25+
see [Cluster-wide transaction vs. Single-node transaction](../../../client-api/session/cluster-transaction/overview#cluster-wide-transaction-vs.-single-node-transaction).
26+
27+
---
28+
29+
* In this article:
1830
* [Delete by dynamic query](../../../client-api/operations/common/delete-by-query#delete-by-dynamic-query)
1931
* [Delete by index query](../../../client-api/operations/common/delete-by-query#delete-by-index-query)
2032
* [Syntax](../../../client-api/operations/common/delete-by-query#syntax)
@@ -23,32 +35,30 @@
2335

2436
{PANEL: Delete by dynamic query}
2537

26-
{NOTE: }
38+
{CONTENT-FRAME: }
2739

28-
**Delete all documents in collection**:
40+
##### Delete all documents in collection
2941

3042
{CODE-TABS}
31-
{CODE-TAB:nodejs:DeleteOperation delete_by_query_0@client-api\Operations\Common\deleteByQuery.js /}
43+
{CODE-TAB:nodejs:DeleteByQueryOperation delete_by_query_0@client-api\Operations\Common\deleteByQuery.js /}
3244
{CODE-TAB-BLOCK:sql:RQL}
3345
from "Orders"
3446
{CODE-TAB-BLOCK/}
3547
{CODE-TABS/}
3648

37-
{NOTE/}
38-
39-
{NOTE: }
49+
{CONTENT-FRAME/}
50+
{CONTENT-FRAME: }
4051

41-
**Delete with filtering**:
52+
##### Delete with filtering
4253

4354
{CODE-TABS}
44-
{CODE-TAB:nodejs:DeleteOperation delete_by_query_1@client-api\Operations\Common\deleteByQuery.js /}
55+
{CODE-TAB:nodejs:DeleteByQueryOperation delete_by_query_1@client-api\Operations\Common\deleteByQuery.js /}
4556
{CODE-TAB-BLOCK:sql:RQL}
4657
from "Orders" where Freight > 30
4758
{CODE-TAB-BLOCK/}
4859
{CODE-TABS/}
4960

50-
{NOTE/}
51-
61+
{CONTENT-FRAME/}
5262
{PANEL/}
5363

5464
{PANEL: Delete by index query}
@@ -60,55 +70,51 @@ from "Orders" where Freight > 30
6070

6171
---
6272

63-
{NOTE: }
73+
{CONTENT-FRAME: }
6474

65-
**A sample Map-index**:
75+
##### A sample Map-index
6676

6777
{CODE:nodejs the_index@client-api\Operations\Common\deleteByQuery.js /}
6878

69-
{NOTE/}
79+
{CONTENT-FRAME/}
80+
{CONTENT-FRAME: }
7081

71-
{NOTE: }
72-
73-
**Delete documents via an index query**:
82+
##### Delete documents via an index query
7483

7584
{CODE-TABS}
76-
{CODE-TAB:nodejs:DeleteOperation delete_by_query_2@client-api\Operations\Common\deleteByQuery.js /}
77-
{CODE-TAB:nodejs:DeleteOperation_overload delete_by_query_3@client-api\Operations\Common\deleteByQuery.js /}
85+
{CODE-TAB:nodejs:DeleteByQueryOperation delete_by_query_2@client-api\Operations\Common\deleteByQuery.js /}
86+
{CODE-TAB:nodejs:DeleteByQueryOperation_overload delete_by_query_3@client-api\Operations\Common\deleteByQuery.js /}
7887
{CODE-TAB-BLOCK:sql:RQL}
7988
from index "Products/ByPrice" where Price > 10
8089
{CODE-TAB-BLOCK/}
8190
{CODE-TABS/}
8291

83-
{NOTE/}
92+
{CONTENT-FRAME/}
93+
{CONTENT-FRAME: }
8494

85-
{NOTE: }
86-
87-
**Delete with options**:
95+
##### Delete with options
8896

8997
{CODE-TABS}
90-
{CODE-TAB:nodejs:DeleteOperation delete_by_query_4@client-api\Operations\Common\deleteByQuery.js /}
98+
{CODE-TAB:nodejs:DeleteByQueryOperation delete_by_query_4@client-api\Operations\Common\deleteByQuery.js /}
9199
{CODE-TAB-BLOCK:sql:RQL}
92100
from index "Products/ByPrice" where Price > 10
93101
{CODE-TAB-BLOCK/}
94102
{CODE-TABS/}
95103

96104
* Specifying `options` is also supported by the other overload methods, see the Syntax section below.
97105

98-
{NOTE/}
99-
106+
{CONTENT-FRAME/}
100107
{PANEL/}
101108

102109
{PANEL: Syntax}
103110

104111
{CODE:nodejs syntax_1@client-api\Operations\Common\deleteByQuery.js /}
105-
<br />
106112

107-
| Parameter | Type | Description |
108-
|-------------------|-----------------------------|------------------------------------------------------------|
109-
| **queryToDelete** | `string` | The RQL query to perform |
110-
| **queryToDelete** | `IndexQuery` | Holds all the information required to query an index |
111-
| **options** | `object` | Object holding different setting options for the operation |
113+
| Parameter | Type | Description |
114+
|-------------------|--------------|------------------------------------------------------------|
115+
| **queryToDelete** | `string` | The RQL query to perform |
116+
| **queryToDelete** | `IndexQuery` | Holds all the information required to query an index |
117+
| **options** | `object` | Object holding different setting options for the operation |
112118

113119
{CODE:nodejs syntax_2@client-api\Operations\Common\DeleteByQuery.js /}
114120

Documentation/5.4/Raven.Documentation.Pages/client-api/operations/common/delete-by-query.php.markdown

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,21 @@
1212

1313
* **Background operation**:
1414
This operation is performed in the background on the server.
15+
If needed, you can wait for the operation to complete. See: [Wait for completion](../../../client-api/operations/what-are-operations#wait-for-completion).
1516

16-
* In this page:
17+
* **Operation scope**:
18+
`DeleteByQueryOperation` runs as a single-node transaction, not a cluster-wide transaction. As a result,
19+
if you use this operation to delete documents that were originally created using a cluster-wide transaction,
20+
their associated [Atomic guards](../../../client-api/session/cluster-transaction/atomic-guards) will Not be deleted.
21+
22+
* To avoid issues when recreating such documents using a cluster-wide session,
23+
see [Best practice when storing a document](../../../client-api/session/cluster-transaction/atomic-guards#best-practice-when-storing-a-document-in-a-cluster-wide-transaction).
24+
* To learn more about the differences between transaction types,
25+
see [Cluster-wide transaction vs. Single-node transaction](../../../client-api/session/cluster-transaction/overview#cluster-wide-transaction-vs.-single-node-transaction).
26+
27+
---
28+
29+
* In this article:
1730
* [Delete by dynamic query](../../../client-api/operations/common/delete-by-query#delete-by-dynamic-query)
1831
* [Delete by index query](../../../client-api/operations/common/delete-by-query#delete-by-index-query)
1932
* [Syntax](../../../client-api/operations/common/delete-by-query#syntax)
@@ -22,7 +35,9 @@
2235

2336
{PANEL: Delete by dynamic query}
2437

25-
#### Delete all documents in a collection:
38+
{CONTENT-FRAME: }
39+
40+
##### Delete all documents in a collection
2641

2742
{CODE-TABS}
2843
{CODE-TAB:php:DeleteByQueryOperation delete_by_query_0@ClientApi\Operations\Common\DeleteByQuery.php /}
@@ -31,9 +46,10 @@ from "Orders"
3146
{CODE-TAB-BLOCK/}
3247
{CODE-TABS/}
3348

34-
---
49+
{CONTENT-FRAME/}
50+
{CONTENT-FRAME: }
3551

36-
#### Delete with filtering:
52+
##### Delete with filtering
3753

3854
{CODE-TABS}
3955
{CODE-TAB:php:DeleteByQueryOperation delete_by_query_1@ClientApi\Operations\Common\DeleteByQuery.php /}
@@ -42,6 +58,7 @@ from "Orders" where Freight > 30
4258
{CODE-TAB-BLOCK/}
4359
{CODE-TABS/}
4460

61+
{CONTENT-FRAME/}
4562
{PANEL/}
4663

4764
{PANEL: Delete by index query}
@@ -53,25 +70,29 @@ from "Orders" where Freight > 30
5370

5471
---
5572

56-
#### A sample Map-index:
73+
{CONTENT-FRAME: }
74+
75+
##### A sample Map-index
5776

5877
{CODE:php the_index@ClientApi\Operations\Common\DeleteByQuery.php /}
5978

60-
---
79+
{CONTENT-FRAME/}
80+
{CONTENT-FRAME: }
6181

62-
#### Delete documents via an index query:
82+
##### Delete documents via an index query
6383

6484
{CODE-TABS}
65-
{CODE-TAB:php:RQL delete_by_query_2@ClientApi\Operations\Common\DeleteByQuery.php /}
85+
{CODE-TAB:php:Query delete_by_query_2@ClientApi\Operations\Common\DeleteByQuery.php /}
6686
{CODE-TAB:php:IndexQuery delete_by_query_3@ClientApi\Operations\Common\DeleteByQuery.php /}
6787
{CODE-TAB-BLOCK:sql:RQL}
6888
from index "Products/ByPrice" where Price > 10
6989
{CODE-TAB-BLOCK/}
7090
{CODE-TABS/}
7191

72-
---
92+
{CONTENT-FRAME/}
93+
{CONTENT-FRAME: }
7394

74-
#### Delete with options:
95+
##### Delete with options
7596

7697
{CODE-TABS}
7798
{CODE-TAB:php:QueryOperationOptions delete_by_query_6@ClientApi\Operations\Common\DeleteByQuery.php /}
@@ -80,18 +101,18 @@ from index "Products/ByPrice" where Price > 10
80101
{CODE-TAB-BLOCK/}
81102
{CODE-TABS/}
82103

104+
{CONTENT-FRAME/}
83105
{PANEL/}
84106

85107
{PANEL: Syntax}
86108

87109
{CODE:php syntax_1@ClientApi\Operations\Common\DeleteByQuery.php /}
88-
<br />
89110

90-
| Parameter | Type | Description |
91-
|-------------------|---------------------------|--------------------------|
92-
| **$queryToDelete** | `string` | The RQL query to perform |
93-
| **$queryToDelete** | `IndexQuery` | Holds all the information required to query an index |
94-
| **$options** | `?QueryOperationOptions` | Object holding different setting options for the operation |
111+
| Parameter | Type | Description |
112+
|--------------------|--------------------------|------------------------------------------------------------|
113+
| **$queryToDelete** | `string` | The RQL query to perform |
114+
| **$queryToDelete** | `IndexQuery` | Holds all the information required to query an index |
115+
| **$options** | `?QueryOperationOptions` | Object holding different setting options for the operation |
95116

96117
{CODE:php syntax_2@ClientApi\Operations\Common\DeleteByQuery.php /}
97118

0 commit comments

Comments
 (0)