You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// SyncFnDryrun Runs a document through the sync function and returns expiry, channels doc was placed in, access map for users, roles, handler errors and sync fn exceptions
| Yes | No | The document passed will be considered as newDoc and oldDoc will be empty |
20
+
| Yes | Yes | The document passed in the body will be newDoc and DocID will be read from the bucket/collection and will be passed as the oldDoc. If DocID doesn't exist, then oldDoc will be empty |
21
+
| No | No | Will throw an error |
22
+
| No | Yes | The docID will be passed in as the newDoc and oldDoc will be empty. If the document is not found, an error will be returned |
23
+
14
24
* Sync Gateway Application Read Only
15
25
requestBody:
16
26
content:
17
27
application/json:
18
28
schema:
19
-
$ref: ../../components/schemas.yaml#/Document
29
+
type: object
30
+
properties:
31
+
sync_function:
32
+
description: |-
33
+
A JavaScript function that defines custom access, channel, and
34
+
validation logic for documents. This function will be evaluated
35
+
by the Sync Gateway to determine document routing, access
36
+
grants, and validation outcomes during synchronization.
37
+
type: string
38
+
example: |-
39
+
function (doc, oldDoc) {
40
+
channel(doc.channels);
41
+
}
42
+
doc:
43
+
$ref: ../../components/schemas.yaml#/Document
20
44
responses:
21
45
'200':
22
46
description: Document Processed by sync function successfully
0 commit comments