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
Copy file name to clipboardExpand all lines: library/src/main/java/io/appwrite/services/Databases.kt
-58Lines changed: 0 additions & 58 deletions
Original file line number
Diff line number
Diff line change
@@ -146,64 +146,6 @@ class Databases(client: Client) : Service(client) {
146
146
nestedType = classOf(),
147
147
)
148
148
149
-
/**
150
-
* Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
151
-
*
152
-
* @param databaseId Database ID.
153
-
* @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.
154
-
* @param documents Array of documents data as JSON objects.
155
-
* @return [io.appwrite.models.DocumentList<T>]
156
-
*/
157
-
suspendfun <T> createDocuments(
158
-
databaseId:String,
159
-
collectionId:String,
160
-
documents:List<Any>,
161
-
nestedType:Class<T>,
162
-
): io.appwrite.models.DocumentList<T> {
163
-
val apiPath ="/databases/{databaseId}/collections/{collectionId}/documents"
164
-
.replace("{databaseId}", databaseId)
165
-
.replace("{collectionId}", collectionId)
166
-
167
-
val apiParams = mutableMapOf<String, Any?>(
168
-
"documents" to documents,
169
-
)
170
-
val apiHeaders = mutableMapOf<String, String>(
171
-
"content-type" to "application/json",
172
-
)
173
-
val converter: (Any) -> io.appwrite.models.DocumentList<T> = {
174
-
@Suppress("UNCHECKED_CAST")
175
-
io.appwrite.models.DocumentList.from(map = it asMap<String, Any>, nestedType)
176
-
}
177
-
return client.call(
178
-
"POST",
179
-
apiPath,
180
-
apiHeaders,
181
-
apiParams,
182
-
responseType = classOf(),
183
-
converter,
184
-
)
185
-
}
186
-
187
-
/**
188
-
* Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
189
-
*
190
-
* @param databaseId Database ID.
191
-
* @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.
192
-
* @param documents Array of documents data as JSON objects.
0 commit comments