-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1870 from reebhub/Python_DocExt2_Cnt_At
[Python] Document-extensions pages batch - Counters, Attachments [Replace C# samples]
- Loading branch information
Showing
63 changed files
with
5,256 additions
and
131 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
...Documentation.Pages/document-extensions/attachments/bulk-insert.python.markdown
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Bulk Insert Attachments | ||
|
||
--- | ||
|
||
{NOTE: } | ||
|
||
* [bulk_insert](../../client-api/bulk-insert/how-to-work-with-bulk-insert-operation) is RavenDB's | ||
high-performance data insertion operation. | ||
Use its `attachments_for` interface to add attachments to multiple documents with great speed. | ||
* Use `store` | ||
|
||
* In this page: | ||
* [Usage flow](../../document-extensions/attachments/bulk-insert#usage-flow) | ||
* [Usage example](../../document-extensions/attachments/bulk-insert#usage-example) | ||
|
||
{NOTE/} | ||
|
||
{PANEL: Usage flow} | ||
|
||
* Create a `bulk_insert` instance. | ||
|
||
* Pass the Document ID to the instance's `attachments_for` method. | ||
|
||
* To add an attachment, call the `store` method. | ||
Pass it the attachment's name, stream, and type (optional). | ||
`store` can be called repeatedly, as many times as needed. | ||
|
||
* Note: | ||
If an attachment with the specified name already exists on the document, | ||
the bulk insert operation will overwrite it. | ||
|
||
{PANEL/} | ||
|
||
{PANEL: Usage example} | ||
|
||
In this example, we attach a file to all User documents that match a query. | ||
{CODE:python bulk_insert_attachment@DocumentExtensions\Attachments\BulkInsert.py /} | ||
|
||
{PANEL/} | ||
|
||
## Related articles | ||
|
||
### Attachments | ||
|
||
- [Storing](../../document-extensions/attachments/storing) | ||
- [Loading](../../document-extensions/attachments/loading) | ||
- [Deleting](../../document-extensions/attachments/deleting) |
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
56 changes: 56 additions & 0 deletions
56
...n.Pages/document-extensions/attachments/copying-moving-renaming.python.markdown
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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Attachments: Copy, Move, Rename | ||
|
||
Attachments can be copied, moved, or renamed using built-in session methods. | ||
All of those actions are executed when `save_changes` is called and take place on the server-side, | ||
removing the need to transfer the entire attachment binary data over the network in order to perform the action. | ||
|
||
{PANEL: Copy attachment} | ||
|
||
Attachment can be copied using one of the `session.advanced.attachments.copy` methods: | ||
|
||
### Syntax | ||
|
||
{CODE:python copy_0@DocumentExtensions\Attachments\CopyMoveRename.py /} | ||
|
||
### Example | ||
|
||
{CODE:python copy_1@DocumentExtensions\Attachments\CopyMoveRename.py /} | ||
|
||
{PANEL/} | ||
|
||
{PANEL: Move attachment} | ||
|
||
Attachment can be moved using one of the `session.advanced.attachments.move` methods: | ||
|
||
### Syntax | ||
|
||
{CODE:python move_0@DocumentExtensions\Attachments\CopyMoveRename.py /} | ||
|
||
### Example | ||
|
||
{CODE:python move_1@DocumentExtensions\Attachments\CopyMoveRename.py /} | ||
|
||
{PANEL/} | ||
|
||
{PANEL: Rename attachment} | ||
|
||
Attachment can be renamed using one of the `session.advanced.attachments.rename` methods: | ||
|
||
### Syntax | ||
|
||
{CODE:python rename_0@DocumentExtensions\Attachments\CopyMoveRename.py /} | ||
|
||
### Example | ||
|
||
{CODE:python rename_1@DocumentExtensions\Attachments\CopyMoveRename.py /} | ||
|
||
{PANEL/} | ||
|
||
## Related Articles | ||
|
||
### Attachments | ||
|
||
- [What are Attachments](../../document-extensions/attachments/what-are-attachments) | ||
- [Storing](../../document-extensions/attachments/storing) | ||
- [Loading](../../document-extensions/attachments/loading) | ||
- [Deleting](../../document-extensions/attachments/deleting) |
22 changes: 22 additions & 0 deletions
22
...en.Documentation.Pages/document-extensions/attachments/deleting.dotnet.markdown
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Attachments: Deleting Attachments | ||
|
||
**Delete** from `session.Advanced.Attachments` is used to remove an attachment from a document. | ||
|
||
## Syntax | ||
|
||
{CODE DeleteSyntax@DocumentExtensions\Attachments\Attachments.cs /} | ||
|
||
## Example | ||
|
||
{CODE-TABS} | ||
{CODE-TAB:csharp:Sync DeleteAttachment@DocumentExtensions\Attachments\Attachments.cs /} | ||
{CODE-TAB:csharp:Async DeleteAttachmentAsync@DocumentExtensions\Attachments\Attachments.cs /} | ||
{CODE-TABS/} | ||
|
||
## Related Articles | ||
|
||
### Attachments | ||
|
||
- [What are Attachments](../../document-extensions/attachments/what-are-attachments) | ||
- [Storing](../../document-extensions/attachments/storing) | ||
- [Loading](../../document-extensions/attachments/loading) |
19 changes: 19 additions & 0 deletions
19
...aven.Documentation.Pages/document-extensions/attachments/deleting.java.markdown
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Attachments: Deleting Attachments | ||
|
||
**Delete** from `session.advanced().attachments()` is used to remove an attachment from a document. | ||
|
||
## Syntax | ||
|
||
{CODE:java DeleteSyntax@DocumentExtensions\Attachments\Attachments.java /} | ||
|
||
## Example | ||
|
||
{CODE:java DeleteAttachment@DocumentExtensions\Attachments\Attachments.java /} | ||
|
||
## Related Articles | ||
|
||
### Attachments | ||
|
||
- [What are Attachments](../../document-extensions/attachments/what-are-attachments) | ||
- [Storing](../../document-extensions/attachments/storing) | ||
- [Loading](../../document-extensions/attachments/loading) |
19 changes: 19 additions & 0 deletions
19
.../Raven.Documentation.Pages/document-extensions/attachments/deleting.js.markdown
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Attachments: Deleting Attachments | ||
|
||
The method `session.advanced.attachments.delete()` is used to remove an attachment from a document. | ||
|
||
## Syntax | ||
|
||
{CODE:nodejs DeleteSyntax@DocumentExtensions\Attachments\attachments.js /} | ||
|
||
## Example | ||
|
||
{CODE:nodejs DeleteAttachment@DocumentExtensions\Attachments\attachments.js /} | ||
|
||
## Related Articles | ||
|
||
### Attachments | ||
|
||
- [What are Attachments](../../document-extensions/attachments/what-are-attachments) | ||
- [Storing](../../document-extensions/attachments/storing) | ||
- [Loading](../../document-extensions/attachments/loading) |
19 changes: 19 additions & 0 deletions
19
...en.Documentation.Pages/document-extensions/attachments/deleting.python.markdown
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Attachments: Deleting Attachments | ||
|
||
**Delete** from `session.advanced.attachments` is used to remove an attachment from a document. | ||
|
||
## Syntax | ||
|
||
{CODE:python DeleteSyntax@DocumentExtensions\Attachments\Attachments.py /} | ||
|
||
## Example | ||
|
||
{CODE:python DeleteAttachment@DocumentExtensions\Attachments\Attachments.py /} | ||
|
||
## Related Articles | ||
|
||
### Attachments | ||
|
||
- [What are Attachments](../../document-extensions/attachments/what-are-attachments) | ||
- [Storing](../../document-extensions/attachments/storing) | ||
- [Loading](../../document-extensions/attachments/loading) |
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
Oops, something went wrong.