Contact usSystem StatusStart using Credal
  • Getting Started
    • Introduction
    • Quickstart
    • Agent Building Webinars
  • Platform
    • Bulk Analysis
  • API Reference
LogoLogo
Contact usSystem StatusStart using Credal
API ReferenceDocument Collections

Beta
POST
https://api.credal.ai/api/v0/documentCollections/mongodb/updateMongoSync
POST
/api/v0/documentCollections/mongodb/updateMongoSync
1import uuid
2
3from credal import CredalApi
4from credal.document_collections import (
5 MongoCollectionSyncConfig,
6 MongoSourceFieldsConfig,
7)
8
9client = CredalApi(
10 api_key="YOUR_API_KEY",
11)
12client.document_collections.update_mongo_collection_sync(
13 mongo_uri="mongodb+srv://cluster0.abcdefg.mongodb.net/Cluster0?retryWrites=true&w=majority",
14 mongo_credential_id=uuid.UUID(
15 "5988ed76-6ee1-11ef-97dd-1fca54b7c4bc",
16 ),
17 config=MongoCollectionSyncConfig(
18 sync_name="My recent summarized sales transcripts",
19 collection_name="myCollection",
20 filter_expression={
21 "transcriptDatetime": {"$gt": "2023-01-01T00:00:00.000Z"}
22 },
23 source_fields=MongoSourceFieldsConfig(
24 body="transcriptSummary",
25 source_name="meetingName",
26 source_system_updated="transcriptDatetime",
27 source_url="link",
28 ),
29 ),
30)
Try it
200Example0
1{
2 "mongoCredentialId": "5988ed76-6ee1-11ef-97dd-1fca54b7c4bc",
3 "resourceId": "mongo-collection-credal-sync-bfd82450-6c68-11ef-bb2b-f7176fe2f3c4",
4 "syncLaunched": true
5}
Was this page helpful?
Previous

Search Document Collection

Next
Built with
Credal lets you easily sync your MongoDB data for use in Collections and Agents. Update an existing sync from a MongoDB collection to a Credal collection via the `mongoCredentialId`, to disambiguate between multiple potential syncs to a given collection.
Update Mongo Collection Sync

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
mongoCredentialIdUUIDRequired
mongoURIstringRequired
configobjectRequired

Response

This endpoint returns an object.
mongoCredentialIdUUID
resourceIdstring
syncLaunchedboolean

Credal lets you easily sync your MongoDB data for use in Collections and Agents. Update an existing sync from a MongoDB collection to a Credal collection via the mongoCredentialId, to disambiguate between multiple potential syncs to a given collection.