package client
- Alphabetic
- Public
- Protected
Type Members
- final case class CollectionCodecRef[Doc](database: String, collection: String, clazz: Class[Doc], codecProviders: CodecProvider*) extends CollectionRef[Doc] with Product with Serializable
Represents the reference to a collection with a custom codec.
Represents the reference to a collection with a custom codec.
Example
import monix.connect.mongodb.client.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("businessDb", "employees_collection", classOf[Employee], createCodecProvider[Employee]()) val companiesCol = CollectionCodecRef("businessDb", "companies_collection", classOf[Company], createCodecProvider[Company](), createCodecProvider[Employee]())
- final case class CollectionDocumentRef(database: String, collection: String) extends CollectionRef[Document] with Product with Serializable
Represents the reference to a collection, typed in a generic abstraction, as Document.
Represents the reference to a collection, typed in a generic abstraction, as Document.
Example
import monix.connect.mongodb.client.{CollectionRef, CollectionDocumentRef} import org.bson.Document // only requires db and collection names val genericDocCol: CollectionRef[Document] = CollectionDocumentRef("businessDb", "employees_collection")
- final case class CollectionOperator[Doc](db: MongoDb, source: MongoSource[Doc], single: MongoSingle[Doc], sink: MongoSink[Doc]) extends Product with Serializable
Comprehends the set of classes needed to communicate and operate with mongodb.
Comprehends the set of classes needed to communicate and operate with mongodb.
- db
provides operations to create, drop, list and check existence of both databases and collections.
- source
provides operations that requires reading from database, like finding or counting documents.
- single
provides operations to execute a single task, like inserting, replacing or deleting documents at once.
- sink
provides the same operations as MongoSingle, but it is designed and exposed as a reactive subscriber Consumer.
- trait CollectionRef[+Doc] extends AnyRef
Value Members
- 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.
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.