object MongoConnection
Singleton object that exposes signatures to create a connection to the desired specified mongo collections, the abstraction to operate with collections is returned in form of CollectionOperator, which is based of three different components, the db, source, single and sink.
The aim is to provide a idiomatic interface for different operations that can be run against a collection, for either read with MongoSource or to write/delete one by one with MongoSingle or in streaming fashion with the MongoSink.
- Source
- MongoConnection.scala
- Alphabetic
- By Inheritance
- MongoConnection
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def create1[T1](clientSettings: MongoClientSettings, collection: CollectionRef[T1]): Resource[Task, CollectionOperator[T1]]
Creates a resource-safe mongodb connection, that encapsulates a CollectionOperator to interoperate with the given CollectionRefs.
Creates a resource-safe mongodb connection, that encapsulates a CollectionOperator to interoperate with the given CollectionRefs.
Example
import com.mongodb.client.model.Filters import monix.eval.Task import com.mongodb.{MongoClientSettings, ServerAddress} import monix.connect.mongodb.client.{MongoConnection, CollectionOperator, CollectionCodecRef} import org.mongodb.scala.bson.codecs.Macros.createCodecProvider import scala.jdk.CollectionConverters._ case class Employee(name: String, age: Int, companyName: String = "X") val employee = Employee("Stephen", 32) val employeesCol = CollectionCodecRef("myDb", "employees", classOf[Employee], createCodecProvider[Employee]()) val mongoClientSettings = MongoClientSettings.builder .applyToClusterSettings(builder => builder.hosts(List(new ServerAddress("localhost", 27017)).asJava)) .build val connection = MongoConnection.create1(mongoClientSettings, employeesCol) val t: Task[Employee] = connection.use { case CollectionOperator(db, source, single, sink) => // business logic here single.insertOne(employee) .flatMap(_ => source.find(Filters.eq("name", employee.name)).headL) }
- clientSettings
various settings to control the behavior the created CollectionOperator.
- collection
the collection reference which we want to interoperate with, represented as CollectionRef.
- returns
a Resource that provides a single CollectionOperator instance, linked to the specified CollectionRef.
- def create1[T1](connectionString: String, collection: CollectionRef[T1]): Resource[Task, CollectionOperator[T1]]
Creates a resource-safe mongodb connection that encapsulates a CollectionOperator to interoperate with the given CollectionRef.
Creates a resource-safe mongodb connection that encapsulates a CollectionOperator to interoperate with the given CollectionRef.
Example
import com.mongodb.client.model.Filters import monix.eval.Task import monix.connect.mongodb.client.{MongoConnection, CollectionOperator, CollectionCodecRef} import org.mongodb.scala.bson.codecs.Macros.createCodecProvider case class Employee(name: String, age: Int, companyName: String = "X") val employee = Employee("Stephen", 32) val employeesCol = CollectionCodecRef("myDb", "employees", classOf[Employee], createCodecProvider[Employee]()) val connection = MongoConnection.create1("mongodb://localhost:27017", employeesCol) val t: Task[Employee] = connection.use { case CollectionOperator(db, source, single, sink) => // business logic here single.insertOne(employee) .flatMap(_ => source.find(Filters.eq("name", employee.name)).headL) }
- connectionString
describes the hosts, ports and options to be used.
- collection
the collection reference which we want to interoperate with, represented CollectionRef.
- returns
a Resource that provides a single CollectionOperator instance, linked to the specified CollectionRef.
- See also
for more information to configure the connection string https://mongodb.github.io/mongo-java-driver/3.9/javadoc/com/mongodb/ConnectionString.html and https://mongodb.github.io/mongo-java-driver/3.7/driver/tutorials/connect-to-mongodb/
- def create2[T1, T2](clientSettings: MongoClientSettings, collections: Tuple2F[CollectionRef, T1, T2]): Resource[Task, Tuple2F[CollectionOperator, T1, T2]]
Creates a resource-safe mongodb connection that encapsulates a Tuple2 of CollectionOperator to interoperate with its relative CollectionRefs, given in the
collections
parameter.Creates a resource-safe mongodb connection that encapsulates a Tuple2 of CollectionOperator to interoperate with its relative CollectionRefs, given in the
collections
parameter.Example
import monix.eval.Task import monix.connect.mongodb.client.{MongoConnection, CollectionOperator, CollectionCodecRef} import com.mongodb.{MongoClientSettings, ServerAddress} import org.mongodb.scala.bson.codecs.Macros.createCodecProvider import scala.jdk.CollectionConverters._ case class Employee(name: String, age: Int, companyName: String = "X") case class Company(name: String, employees: List[Employee], investment: Int = 0) val employee1 = Employee("Gerard", 39) val employee2 = Employee("Laura", 41) val company = Company("Stephen", List(employee1, employee2)) val employeesCol = CollectionCodecRef("business", "employees_collection", classOf[Employee], createCodecProvider[Employee]()) val companiesCol = CollectionCodecRef("business", "companies_collection", classOf[Company], createCodecProvider[Company](), createCodecProvider[Employee]()) val mongoClientSettings = MongoClientSettings.builder .applyToClusterSettings(builder => builder.hosts(List(new ServerAddress("localhost", 27017)).asJava)) .build val connection = MongoConnection.create2(mongoClientSettings, (employeesCol, companiesCol)) val t: Task[Unit] = connection.use { case (CollectionOperator(_, employeeSource, employeeSingle, employeeSink), CollectionOperator(_, companySource, companySingle, companySink)) => // business logic here for { r1 <- employeeSingle.insertMany(List(employee1, employee2)) r2 <- companySingle.insertOne(company) } yield () }
- clientSettings
various settings to control the behavior of the created CollectionOperators.
- collections
the two collection references which we want to interoperate with represented as Tuple2 of the CollectionRef
- returns
a Resource that provides a single CollectionOperator instance, linked to the specified CollectionRef.
- def create2[T1, T2](connectionString: String, collections: Tuple2F[CollectionRef, T1, T2]): Resource[Task, Tuple2F[CollectionOperator, T1, T2]]
Creates a resource-safe mongodb connection that encapsulates a Tuple2 of CollectionOperator to interoperate with its relative CollectionRefs given in the
collections
parameter.Creates a resource-safe mongodb connection that encapsulates a Tuple2 of CollectionOperator to interoperate with its relative CollectionRefs given in the
collections
parameter.Example
import monix.eval.Task import monix.connect.mongodb.client.{MongoConnection, CollectionOperator, CollectionCodecRef} import org.mongodb.scala.bson.codecs.Macros.createCodecProvider case class Employee(name: String, age: Int, companyName: String = "X") case class Company(name: String, employees: List[Employee], investment: Int = 0) val employee1 = Employee("Gerard", 39) val employee2 = Employee("Laura", 41) val company = Company("Stephen", List(employee1, employee2)) val employeesCol = CollectionCodecRef("business", "employees_collection", classOf[Employee], createCodecProvider[Employee]()) val companiesCol = CollectionCodecRef("business", "companies_collection", classOf[Company], createCodecProvider[Company](), createCodecProvider[Employee]()) val connection = MongoConnection.create2("mongodb://localhost:27017", (employeesCol, companiesCol)) val t: Task[Unit] = connection.use { case (CollectionOperator(_, employeeSource, employeeSingle, employeeSink), CollectionOperator(_, companySource, companySingle, companySink)) => // business logic here for { r1 <- employeeSingle.insertMany(List(employee1, employee2)) r2 <- companySingle.insertOne(company) } yield () }
- connectionString
describes the hosts, ports and options to be used.
- collections
the two collection references which we want to interoperate with, represented as Tuple2 of CollectionRef.
- returns
a Resource that provides a single CollectionOperator instance, linked to the specified CollectionRefs.
- See also
for more information to configure the connection string https://mongodb.github.io/mongo-java-driver/3.9/javadoc/com/mongodb/ConnectionString.html and https://mongodb.github.io/mongo-java-driver/3.7/driver/tutorials/connect-to-mongodb/
- def create3[T1, T2, T3](clientSettings: MongoClientSettings, collections: Tuple3F[CollectionRef, T1, T2, T3]): Resource[Task, Tuple3F[CollectionOperator, T1, T2, T3]]
Creates a resource-safe mongodb connection that encapsulates a Tuple3 of CollectionOperator to interoperate with its relative CollectionRefs given in the
collections
parameter.Creates a resource-safe mongodb connection that encapsulates a Tuple3 of CollectionOperator to interoperate with its relative CollectionRefs given in the
collections
parameter.- clientSettings
various settings to control the behavior of the created CollectionOperators.
- collections
the three collection references which we want to interoperate with represented as Tuple3 of the CollectionRef
- returns
a Resource that provides a single CollectionOperator instance, linked to the specified CollectionRef.
- def create3[T1, T2, T3](connectionString: String, collections: Tuple3F[CollectionRef, T1, T2, T3]): Resource[Task, Tuple3F[CollectionOperator, T1, T2, T3]]
Creates a resource-safe mongodb connection that encapsulates a Tuple3 of CollectionOperator to interoperate with its relative CollectionRefs, given in the
collections
parameter.Creates a resource-safe mongodb connection that encapsulates a Tuple3 of CollectionOperator to interoperate with its relative CollectionRefs, given in the
collections
parameter.Example
import com.mongodb.client.model.{Filters, Updates} import monix.eval.Task import monix.connect.mongodb.client.{MongoConnection, CollectionCodecRef} import monix.connect.mongodb.domain.UpdateResult import org.mongodb.scala.bson.codecs.Macros.createCodecProvider import scala.concurrent.duration._ import scala.jdk.CollectionConverters._ case class Employee(name: String, age: Int, companyName: String) case class Company(name: String, employees: List[Employee], investment: Int = 0) case class Investor(name: String, funds: Int, companies: List[Company]) val companiesCol = CollectionCodecRef( "my_db", "companies_collection", classOf[Company], createCodecProvider[Company](), createCodecProvider[Employee]()) val employeesCol = CollectionCodecRef("my_db", "employees_collection", classOf[Employee], createCodecProvider[Employee]()) val investorsCol = CollectionCodecRef( "my_db", "investors_collection", classOf[Investor], createCodecProvider[Investor](), createCodecProvider[Company]()) val mongoEndpoint = "mongodb://localhost:27017" val connection = MongoConnection.create3(mongoEndpoint, (companiesCol, employeesCol, investorsCol)) //in this example we are trying to move the employees and investment //from an old company a the new one, presumably, there is already a `Company` //with name `OldCompany` which also have `Employee`s and `Investor`s. val updateResult: Task[UpdateResult] = connection.use { case ( companyConnector, employeeConnector, investorConnector) => for { // creates the new company _ <- companyConnector.single.insertOne(Company("NewCompany", employees = List.empty, investment = 0)).delayResult(1.second) //read employees from old company and pushes them into the new one _ <- { employeeConnector .source .find(Filters.eq("companyName", "OldCompany")) .bufferTimedAndCounted(2.seconds, 15) .map { employees => // pushes them into the new one (Filters.eq("name", "NewCompany"), Updates.pushEach("employees", employees.asJava)) } .consumeWith(companyConnector.sink.updateOne()) } // sums all the investment funds of the old company and updates the total company's investment investment <- investorConnector.source.find(Filters.in("companies.name", "OldCompany")).map(_.funds).sumL updateResult <- companyConnector.single.updateMany( Filters.eq("name", "NewCompany"), Updates.set("investment", investment)) } yield updateResult }
- connectionString
describes the hosts, ports and options to be used.
- collections
the three collection references which we want to interoperate with, represented as Tuple3 of CollectionRef.
- returns
a Resource that provides a single CollectionOperator instance, linked to the specified CollectionRefs.
- See also
for more information to configure the connection string https://mongodb.github.io/mongo-java-driver/3.9/javadoc/com/mongodb/ConnectionString.html and https://mongodb.github.io/mongo-java-driver/3.7/driver/tutorials/connect-to-mongodb/
- def create4[T1, T2, T3, T4](clientSettings: MongoClientSettings, collections: Tuple4F[CollectionRef, T1, T2, T3, T4]): Resource[Task, Tuple4F[CollectionOperator, T1, T2, T3, T4]]
Creates a resource-safe mongodb connection that encapsulates a Tuple4 of CollectionOperator to interoperate with its relative CollectionRefs given in the
collections
parameter.Creates a resource-safe mongodb connection that encapsulates a Tuple4 of CollectionOperator to interoperate with its relative CollectionRefs given in the
collections
parameter.- clientSettings
various settings to control the behavior of the created CollectionOperators.
- collections
the four collection references which we want to interoperate with, represented as Tuple4 of CollectionRef.
- returns
a Resource that provides a single CollectionOperator instance, linked to the specified CollectionRef.
- def create4[T1, T2, T3, T4](connectionString: String, collections: Tuple4F[CollectionRef, T1, T2, T3, T4]): Resource[Task, Tuple4F[CollectionOperator, T1, T2, T3, T4]]
Creates a resource-safe mongodb connection that encapsulates a Tuple4 of CollectionOperator to interoperate with its relative CollectionRefs given in the
collections
parameter.Creates a resource-safe mongodb connection that encapsulates a Tuple4 of CollectionOperator to interoperate with its relative CollectionRefs given in the
collections
parameter.- connectionString
describes the hosts, ports and options to be used.
- collections
the four collection references which we want to interoperate with, represented as Tuple4 of CollectionRef.
- returns
a Resource that provides a single CollectionOperator instance, linked to the specified CollectionRefs.
- See also
an example of usage could be extrapolated from the scaladoc example of create1, create2 and create3.
for more information on how to configure it https://mongodb.github.io/mongo-java-driver/3.9/javadoc/com/mongodb/ConnectionString.html and https://mongodb.github.io/mongo-java-driver/3.7/driver/tutorials/connect-to-mongodb/
- def create5[T1, T2, T3, T4, T5](clientSettings: MongoClientSettings, collections: Tuple5F[CollectionRef, T1, T2, T3, T4, T5]): Resource[Task, Tuple5F[CollectionOperator, T1, T2, T3, T4, T5]]
Creates a resource-safe mongodb connection that encapsulates a Tuple5 of CollectionOperator to interoperate with its relative CollectionRefs given in the
collections
parameter.Creates a resource-safe mongodb connection that encapsulates a Tuple5 of CollectionOperator to interoperate with its relative CollectionRefs given in the
collections
parameter.- clientSettings
various settings to control the behavior of the created CollectionOperators.
- collections
the five collection references which we want to interoperate with, represented as Tuple5 of CollectionRef.
- returns
a Resource that provides a single CollectionOperator instance, linked to the specified CollectionRef.
- def create5[T1, T2, T3, T4, T5](connectionString: String, collections: Tuple5F[CollectionRef, T1, T2, T3, T4, T5]): Resource[Task, Tuple5F[CollectionOperator, T1, T2, T3, T4, T5]]
Creates a resource-safe mongodb connection that encapsulates a Tuple5 of CollectionOperator to interoperate with its relative CollectionRefs given in the
collections
parameter.Creates a resource-safe mongodb connection that encapsulates a Tuple5 of CollectionOperator to interoperate with its relative CollectionRefs given in the
collections
parameter.- connectionString
describes the hosts, ports and options to be used.
- collections
the five collection references which we want to interoperate with, represented as Tuple5 of CollectionRef.
- returns
a Resource that provides a single CollectionOperator instance, linked to the specified CollectionRefs.
- See also
an example of usage could be extrapolated from the scaladoc example of create1, create2 and create3.
for more information to configure the connection string https://mongodb.github.io/mongo-java-driver/3.9/javadoc/com/mongodb/ConnectionString.html and https://mongodb.github.io/mongo-java-driver/3.7/driver/tutorials/connect-to-mongodb/
- def create6[T1, T2, T3, T4, T5, T6](clientSettings: MongoClientSettings, collections: Tuple6F[CollectionRef, T1, T2, T3, T4, T5, T6]): Resource[Task, Tuple6F[CollectionOperator, T1, T2, T3, T4, T5, T6]]
Creates a resource-safe mongodb connection that encapsulates a Tuple6 of CollectionOperator to interoperate with its relative CollectionRefs given in the
collections
parameter.Creates a resource-safe mongodb connection that encapsulates a Tuple6 of CollectionOperator to interoperate with its relative CollectionRefs given in the
collections
parameter.- clientSettings
various settings to control the behavior of the created CollectionOperators.
- collections
the six collection references which we want to interoperate with, represented as Tuple5 of CollectionRef.
- returns
a Resource that provides a single CollectionOperator instance, linked to the specified CollectionRef.
- def create6[T1, T2, T3, T4, T5, T6](connectionString: String, collections: Tuple6F[CollectionRef, T1, T2, T3, T4, T5, T6]): Resource[Task, Tuple6F[CollectionOperator, T1, T2, T3, T4, T5, T6]]
Creates a resource-safe mongodb connection that encapsulates a Tuple6 of CollectionOperator to interoperate with its relative CollectionRefs given in the
collections
parameter.Creates a resource-safe mongodb connection that encapsulates a Tuple6 of CollectionOperator to interoperate with its relative CollectionRefs given in the
collections
parameter.- connectionString
describes the hosts, ports and options to be used.
- collections
the six collection references which we want to interoperate with, represented as Tuple5 of CollectionRef.
- returns
a Resource that provides a single CollectionOperator instance, linked to the specified CollectionRefs.
- See also
an example of usage could be extrapolated from the scaladoc example of create1, create2 and create3.
for more information to configure the connection string https://mongodb.github.io/mongo-java-driver/3.9/javadoc/com/mongodb/ConnectionString.html and https://mongodb.github.io/mongo-java-driver/3.7/driver/tutorials/connect-to-mongodb/
- def create7[T1, T2, T3, T4, T5, T6, T7](clientSettings: MongoClientSettings, collections: Tuple7F[CollectionRef, T1, T2, T3, T4, T5, T6, T7]): Resource[Task, Tuple7F[CollectionOperator, T1, T2, T3, T4, T5, T6, T7]]
Creates a resource-safe mongodb connection that encapsulates a Tuple7 of CollectionOperator to interoperate with its relative CollectionRefs given in the
collections
parameter.Creates a resource-safe mongodb connection that encapsulates a Tuple7 of CollectionOperator to interoperate with its relative CollectionRefs given in the
collections
parameter.- clientSettings
various settings to control the behavior of the created CollectionOperators.
- collections
the seven collection references which we want to interoperate with, represented as Tuple7 of CollectionRef.
- returns
a Resource that provides a single CollectionOperator instance, linked to the specified CollectionRef.
- def create7[T1, T2, T3, T4, T5, T6, T7](connectionString: String, collections: Tuple7F[CollectionRef, T1, T2, T3, T4, T5, T6, T7]): Resource[Task, Tuple7F[CollectionOperator, T1, T2, T3, T4, T5, T6, T7]]
Creates a resource-safe mongodb connection that encapsulates a Tuple7 of CollectionOperator to interoperate with its relative CollectionRefs given in the
collections
parameter.Creates a resource-safe mongodb connection that encapsulates a Tuple7 of CollectionOperator to interoperate with its relative CollectionRefs given in the
collections
parameter.- connectionString
describes the hosts, ports and options to be used.
- collections
the seven collection references which we want to interoperate with, represented as Tuple6 of CollectionRef.
- returns
a Resource that provides a single CollectionOperator instance, linked to the specified CollectionRefs.
- See also
an example of usage could be extrapolated from the scaladoc example of create1, create2 and create3.
for more information to configure the connection string https://mongodb.github.io/mongo-java-driver/3.9/javadoc/com/mongodb/ConnectionString.html and https://mongodb.github.io/mongo-java-driver/3.7/driver/tutorials/connect-to-mongodb/
- def create8[T1, T2, T3, T4, T5, T6, T7, T8](clientSettings: MongoClientSettings, collections: Tuple8F[CollectionRef, T1, T2, T3, T4, T5, T6, T7, T8]): Resource[Task, Tuple8F[CollectionOperator, T1, T2, T3, T4, T5, T6, T7, T8]]
Creates a resource-safe mongodb connection that encapsulates a Tuple8 of CollectionOperator to interoperate with its relative CollectionRefs given in the
collections
parameter.Creates a resource-safe mongodb connection that encapsulates a Tuple8 of CollectionOperator to interoperate with its relative CollectionRefs given in the
collections
parameter.- clientSettings
various settings to control the behavior of the created CollectionOperators.
- collections
the eight collection references which we want to interoperate with, represented as Tuple8 of CollectionRef.
- returns
a Resource that provides a single CollectionOperator instance, linked to the specified CollectionRef.
- def create8[T1, T2, T3, T4, T5, T6, T7, T8](connectionString: String, collections: Tuple8F[CollectionRef, T1, T2, T3, T4, T5, T6, T7, T8]): Resource[Task, Tuple8F[CollectionOperator, T1, T2, T3, T4, T5, T6, T7, T8]]
Creates a resource-safe mongodb connection that encapsulates a Tuple8 of CollectionOperator to interoperate with its relative CollectionRefs given in the
collections
parameter.Creates a resource-safe mongodb connection that encapsulates a Tuple8 of CollectionOperator to interoperate with its relative CollectionRefs given in the
collections
parameter.- connectionString
describes the hosts, ports and options to be used.
- collections
the eight collection references which we want to interoperate with, represented as Tuple8 of CollectionRef.
- returns
a Resource that provides a single CollectionOperator instance, linked to the specified CollectionRefs.
- See also
an example of usage could be extrapolated from the scaladoc example of create1, create2 and create3.
for more information to configure the connection string https://mongodb.github.io/mongo-java-driver/3.9/javadoc/com/mongodb/ConnectionString.html and https://mongodb.github.io/mongo-java-driver/3.7/driver/tutorials/connect-to-mongodb/
- def createUnsafe1[T1](client: MongoClient, collection: CollectionRef[T1]): Task[CollectionOperator[T1]]
Unsafely creates mongodb connection that provides a CollectionOperator to interoperate with the respective CollectionRefs.
Unsafely creates mongodb connection that provides a CollectionOperator to interoperate with the respective CollectionRefs.
WARN: It is unsafe because it directly expects an instance of MongoClient, which might have already been closed. The connection resources are not released after its usage, you could use
guarantee
orbracket
to perform the same action.Always prefer to use create1.
- client
an instance of MongoClient
- collection
the collection reference which we want to interoperate with, represented as CollectionRef.
- returns
a Resource that provides a single CollectionOperator instance, linked to the specified CollectionRef
- Annotations
- @UnsafeBecauseImpure()
- def createUnsafe2[T1, T2](client: MongoClient, collections: Tuple2F[CollectionRef, T1, T2]): Task[Tuple2F[CollectionOperator, T1, T2]]
Unsafely creates mongodb connection that provides a Tuple2 of CollectionOperator to interoperate with the respective CollectionRefs, given in the
collections
parameter.Unsafely creates mongodb connection that provides a Tuple2 of CollectionOperator to interoperate with the respective CollectionRefs, given in the
collections
parameter.WARN: It is unsafe because it directly expects an instance of MongoClient, which might have already been closed. The connection resources are not released after its usage, you could use
guarantee
orbracket
to perform the same action. Always prefer to use create2.- client
an instance of MongoClient
- collections
the three collection references which we want to interoperate with, represented as Tuple3 of the CollectionRef
- returns
a Resource that provides a single CollectionOperator instance, linked to the specified CollectionRef
- Annotations
- @UnsafeBecauseImpure()
- def createUnsafe3[T1, T2, T3](client: MongoClient, collections: Tuple3F[CollectionRef, T1, T2, T3]): Task[Tuple3F[CollectionOperator, T1, T2, T3]]
Unsafely creates mongodb connection that provides a to interoperate with the respective CollectionRefs.
Unsafely creates mongodb connection that provides a to interoperate with the respective CollectionRefs.
WARN: It is unsafe because it directly expects an instance of MongoClient, which might have already been closed. The connection resources are not released after its usage, you could use
guarantee
orbracket
to perform the same action. Always prefer to use create3.- client
an instance of MongoClient
- collections
the three collection references which we want to interoperate with, represented as Tuple3 of CollectionRef.
- returns
a Resource that provides a single CollectionOperator instance, linked to the specified CollectionRef
- Annotations
- @UnsafeBecauseImpure()
- def createUnsafe4[T1, T2, T3, T4](client: MongoClient, collections: Tuple4F[CollectionRef, T1, T2, T3, T4]): Task[Tuple4F[CollectionOperator, T1, T2, T3, T4]]
Unsafely creates mongodb connection that provides a to interoperate with the respective CollectionRefs.
Unsafely creates mongodb connection that provides a to interoperate with the respective CollectionRefs.
WARN: It is unsafe because it directly expects an instance of MongoClient, which might have already been closed. The connection resources are not released after its usage, you could use
guarantee
orbracket
to perform the same action. Always prefer to use create4.- client
an instance of MongoClient
- collections
the four collection references which we want to interoperate with, represented as Tuple4 of CollectionRef.
- returns
a Resource that provides a single CollectionOperator instance, linked to the specified CollectionRef
- Annotations
- @UnsafeBecauseImpure()
- def createUnsafe5[T1, T2, T3, T4, T5](client: MongoClient, collections: Tuple5F[CollectionRef, T1, T2, T3, T4, T5]): Task[Tuple5F[CollectionOperator, T1, T2, T3, T4, T5]]
Unsafely creates mongodb connection that provides a to interoperate with the respective CollectionRefs.
Unsafely creates mongodb connection that provides a to interoperate with the respective CollectionRefs.
WARN: It is unsafe because it directly expects an instance of MongoClient, which might have already been closed. The connection resources are not released after its usage, you could use
guarantee
orbracket
to perform the same action. Always prefer to use create5.- client
an instance of MongoClient
- collections
the five collection references which we want to interoperate with, represented as Tuple5 of CollectionRef.
- returns
a Resource that provides a single CollectionOperator instance, linked to the specified CollectionRef
- Annotations
- @UnsafeBecauseImpure()
- def createUnsafe6[T1, T2, T3, T4, T5, T6](client: MongoClient, collections: Tuple6F[CollectionRef, T1, T2, T3, T4, T5, T6]): Task[Tuple6F[CollectionOperator, T1, T2, T3, T4, T5, T6]]
Unsafely creates mongodb connection that provides a to interoperate with the respective CollectionRefs.
Unsafely creates mongodb connection that provides a to interoperate with the respective CollectionRefs.
WARN: It is unsafe because it directly expects an instance of MongoClient, which might have already been closed. The connection resources are not released after its usage, you could use
guarantee
orbracket
to perform the same action. Always prefer to use create6.- client
an instance of MongoClient
- collections
the six collection references which we want to interoperate with, represented as Tuple6 of CollectionRef.
- returns
a Resource that provides a single CollectionOperator instance, linked to the specified CollectionRef
- def createUnsafe7[T1, T2, T3, T4, T5, T6, T7](client: MongoClient, collections: Tuple7F[CollectionRef, T1, T2, T3, T4, T5, T6, T7]): Task[Tuple7F[CollectionOperator, T1, T2, T3, T4, T5, T6, T7]]
Unsafely creates mongodb connection that provides a Tuple7 of CollectionOperator to interoperate with the respective CollectionRefs.
Unsafely creates mongodb connection that provides a Tuple7 of CollectionOperator to interoperate with the respective CollectionRefs.
WARN: It is unsafe because it directly expects an instance of MongoClient, which might have already been closed. The connection resources are not released after its usage, you could use
guarantee
orbracket
to perform the same action. Always prefer to use create7.- client
an instance of MongoClient
- collections
the seven collection references which we want to interoperate with, represented as Tuple7 of CollectionRef.
- returns
a Resource that provides a single CollectionOperator instance, linked to the specified CollectionRef
- Annotations
- @UnsafeBecauseImpure()
- def createUnsafe8[T1, T2, T3, T4, T5, T6, T7, T8](client: MongoClient, collections: Tuple8F[CollectionRef, T1, T2, T3, T4, T5, T6, T7, T8]): Task[Tuple8F[CollectionOperator, T1, T2, T3, T4, T5, T6, T7, T8]]
Unsafely creates mongodb connection that provides a Tuple8 of CollectionOperator to interoperate with the respective CollectionRefs.
Unsafely creates mongodb connection that provides a Tuple8 of CollectionOperator to interoperate with the respective CollectionRefs.
WARN: It is unsafe because it directly expects an instance of MongoClient, which might have already been closed. The connection resources are not released after its usage, you could use
guarantee
orbracket
to perform the same action. Always prefer to use create7.- client
an instance of MongoClient
- collections
the eight collection references which we want to interoperate with, represented as Tuple8 of CollectionRef.
- returns
a Resource that provides a single CollectionOperator instance, linked to the specified CollectionRef
- Annotations
- @UnsafeBecauseImpure()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()