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
/// Provides methods for interacting with a single document within a specific Typesense collection.
12
12
///
13
-
/// This struct is created by calling a method like `client.collection("collection_name").document("document_id")` or `client.collection_of::<MyType>("collection_name").document("document_id")`.
13
+
/// This struct is created by calling a method like `client.collection_schemaless("collection_name").document("document_id")`
14
+
/// or `client.collection::<MyType>().document("document_id")`.
14
15
/// The generic `T` represents the shape of the document and must implement `Serialize` and `DeserializeOwned`.
15
16
/// If `T` is not specified, it defaults to `serde_json::Value` for schemaless interactions.
16
17
pubstructDocument<'c,'n,D = serde_json::Value>
17
18
where
18
19
D:DeserializeOwned + Serialize + Send + Sync,
19
20
{
20
-
pub(super)client:&'cClient,
21
-
pub(super)collection_name:&'nstr,
22
-
pub(super)document_id:String,
23
-
pub(super)_phantom: std::marker::PhantomData<D>,
21
+
client:&'cClient,
22
+
collection_name:&'nstr,
23
+
document_id:String,
24
+
_phantom: std::marker::PhantomData<D>,
24
25
}
25
26
26
27
impl<'c,'n,D>Document<'c,'n,D>
@@ -81,15 +82,15 @@ where
81
82
/// let book_update = serde_json::json!({ "pages": 654 });
82
83
///
83
84
/// // Simple update
84
-
/// let updated_book = client.collection_of::<Book>("books").document("123")
85
+
/// let updated_book = client.collection_named::<Book>("books").document("123")
85
86
/// .update(&book_update, None)
86
87
/// .await?;
87
88
///
88
89
/// // Update with additional parameters
89
90
/// let params = models::DocumentIndexParameters {
0 commit comments