insertMany

@JvmName(name = "insertManyTyped")
inline suspend fun <T : Any> MongoCollection<*>.insertMany(documents: Collection<T>): List<Any>

Insert a list of object into the remote collection.

Return

the _id values of the documents inserted in the collection deserialized to a R-instance.

Parameters

documents

the objects to serialize and insert into the remote collection.

T

the type of object that should be serializer and inserted to the collection.

R

the type that the returned _id values should be deserialized into.

Throws

if the underlying App Service HTTP requests fails.

SerializationException

if documents could not be serialized into a EJson document or if the App Service response could not be deserialized to List<R>.