Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MongoDB dependencies from 5.1.4 to 5.2.0 #130

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ lazy val molly_core = project
Seq(
"co.fs2" %% "fs2-core" % "3.11.0",
"co.fs2" %% "fs2-reactive-streams" % "3.11.0",
"org.mongodb" % "bson" % "5.1.4",
"org.mongodb" % "mongodb-driver-core" % "5.1.4",
"org.mongodb" % "mongodb-driver-reactivestreams" % "5.1.4",
"org.mongodb" % "mongodb-driver-sync" % "5.1.4",
"org.mongodb" % "bson" % "5.2.0",
"org.mongodb" % "mongodb-driver-core" % "5.2.0",
"org.mongodb" % "mongodb-driver-reactivestreams" % "5.2.0",
"org.mongodb" % "mongodb-driver-sync" % "5.2.0",
"org.reactivestreams" % "reactive-streams" % "1.0.4",
"org.typelevel" %% "cats-core" % "2.12.0",
"org.typelevel" %% "cats-effect-kernel" % "3.5.4",
Expand Down
6 changes: 3 additions & 3 deletions molly-core/src/main/scala/molly/core/MollyClient.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import com.mongodb.reactivestreams.client.MongoClient
import com.mongodb.reactivestreams.client.MongoClients

/** Molly's counterpart to
* [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/MongoClient.html MongoClient]].
* [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/MongoClient.html MongoClient]].
*/
final case class MollyClient[F[_]] private (private[core] val delegate: MongoClient)(using f: Async[F]):

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/MongoClient.html#getDatabase(java.lang.String)]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/MongoClient.html#getDatabase(java.lang.String)]]
*/
def getDatabase(name: String): F[MollyDatabase[F]] =
f.delay(delegate.getDatabase(name)).map(MollyDatabase(_))
Expand All @@ -24,7 +24,7 @@ final case class MollyClient[F[_]] private (private[core] val delegate: MongoCli
def getDatabaseAsResource(name: String): Resource[F, MollyDatabase[F]] =
Resource.eval(getDatabase(name))

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/MongoClient.html#getClusterDescription()]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/MongoClient.html#getClusterDescription()]]
*/
def getClusterDescription(): ClusterDescription = delegate.getClusterDescription()

Expand Down
74 changes: 37 additions & 37 deletions molly-core/src/main/scala/molly/core/MollyCollection.scala

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions molly-core/src/main/scala/molly/core/MollyDatabase.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import molly.core.syntax.bsondocument.BsonDocumentCollection
import org.bson.BsonDocument

/** Molly's counterpart to
* [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/MongoDatabase.html MongoDatabase]]
* [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/MongoDatabase.html MongoDatabase]]
*/
final case class MollyDatabase[F[_]] private[core] (private[core] val delegate: MongoDatabase)(using f: Async[F]):

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/MongoDatabase.html#getCollection(java.lang.String)]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/MongoDatabase.html#getCollection(java.lang.String)]]
*/
def getCollection(collectionName: String): F[BsonDocumentCollection[F]] =
f.delay(delegate.getCollection(collectionName, classOf[BsonDocument])).map(MollyCollection(_))
Expand All @@ -40,33 +40,33 @@ final case class MollyDatabase[F[_]] private[core] (private[core] val delegate:
): Resource[F, MollyCollection[F, A]] =
Resource.eval(getTypedCollection(collectionName))

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/MongoDatabase.html#listCollectionNames()]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/MongoDatabase.html#listCollectionNames()]]
*/
def listCollectionNames(): F[List[String]] = fromStreamPublisher(delegate.listCollectionNames(), 1).compile.toList

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/MongoDatabase.html#getReadConcern()]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/MongoDatabase.html#getReadConcern()]]
*/
def getReadConcern(): ReadConcern = delegate.getReadConcern()

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/MongoDatabase.html#getReadPreference()]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/MongoDatabase.html#getReadPreference()]]
*/
def getReadPreference(): ReadPreference = delegate.getReadPreference()

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/MongoDatabase.html#getWriteConcern()]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/MongoDatabase.html#getWriteConcern()]]
*/
def getWriteConcern(): WriteConcern = delegate.getWriteConcern()

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/MongoDatabase.html#withReadConcern(com.mongodb.ReadConcern)]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/MongoDatabase.html#withReadConcern(com.mongodb.ReadConcern)]]
*/
def withReadConcern(readConcern: ReadConcern): MollyDatabase[F] =
MollyDatabase(delegate.withReadConcern(readConcern))

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/MongoDatabase.html#withReadPreference(com.mongodb.ReadPreference]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/MongoDatabase.html#withReadPreference(com.mongodb.ReadPreference]]
*/
def withReadPreference(readPreference: ReadPreference): MollyDatabase[F] =
MollyDatabase(delegate.withReadPreference(readPreference))

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/MongoDatabase.html#withWriteConcern(com.mongodb.WriteConcern)]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/MongoDatabase.html#withWriteConcern(com.mongodb.WriteConcern)]]
*/
def withWriteConcern(writeConcern: WriteConcern): MollyDatabase[F] =
MollyDatabase(delegate.withWriteConcern(writeConcern))
4 changes: 2 additions & 2 deletions molly-core/src/main/scala/molly/core/MollySyncClient.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import com.mongodb.client.MongoClient
import com.mongodb.client.MongoClients

/** Molly's counterpart to
* [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClient.html MongoClient]].
* [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClient.html MongoClient]].
*/
final case class MollySyncClient[F[_]] private (private[core] val delegate: MongoClient)(using f: Async[F]):

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClient.html#getDatabase(java.lang.String)]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClient.html#getDatabase(java.lang.String)]]
*/
def getDatabase(name: String): F[MollySyncDatabase[F]] =
f.delay(delegate.getDatabase(name)).map(MollySyncDatabase(_))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ import org.bson.conversions.Bson
import scala.jdk.CollectionConverters.*

/** Molly's counterpart to
* [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html MongoCollection]].
* [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html MongoCollection]].
*/
final case class MollySyncCollection[F[_], A] private[core] (private[core] val delegate: MongoCollection[BsonDocument])(
using
Async[F],
MollyCodec[F, A]
):

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#watch()]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#watch()]]
*/
def watch(): SyncWatchQuery[F, A] = SyncWatchQuery(delegate.watch(classOf[BsonDocument]))

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#watch(java.util.List)]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#watch(java.util.List)]]
*/
def watch(pipeline: Seq[Bson]): SyncWatchQuery[F, A] =
SyncWatchQuery(delegate.watch(pipeline.asJava, classOf[BsonDocument]))
18 changes: 9 additions & 9 deletions molly-core/src/main/scala/molly/core/MollySyncDatabase.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import org.bson.BsonDocument
import scala.jdk.CollectionConverters.*

/** Molly's counterpart to
* [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html MongoDatabase]]
* [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html MongoDatabase]]
*/
final case class MollySyncDatabase[F[_]] private[core] (private[core] val delegate: MongoDatabase)(using f: Async[F]):

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#getCollection(java.lang.String)]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#getCollection(java.lang.String)]]
*/
def getCollection(collectionName: String): F[MollySyncCollection[F, BsonDocument]] =
f.delay(delegate.getCollection(collectionName, classOf[BsonDocument])).map(MollySyncCollection(_))
Expand All @@ -41,7 +41,7 @@ final case class MollySyncDatabase[F[_]] private[core] (private[core] val delega
): Resource[F, MollySyncCollection[F, A]] =
Resource.eval(getTypedCollection(collectionName))

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#listCollectionNames()]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#listCollectionNames()]]
*/
def listCollectionNames(): F[List[String]] =
Stream
Expand All @@ -50,29 +50,29 @@ final case class MollySyncDatabase[F[_]] private[core] (private[core] val delega
.compile
.toList

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#getReadConcern()]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#getReadConcern()]]
*/
def getReadConcern(): ReadConcern = delegate.getReadConcern()

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#getReadPreference()]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#getReadPreference()]]
*/
def getReadPreference(): ReadPreference = delegate.getReadPreference()

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#getWriteConcern()]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#getWriteConcern()]]
*/
def getWriteConcern(): WriteConcern = delegate.getWriteConcern()

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#withReadConcern(com.mongodb.ReadConcern)]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#withReadConcern(com.mongodb.ReadConcern)]]
*/
def withReadConcern(readConcern: ReadConcern): MollySyncDatabase[F] =
MollySyncDatabase(delegate.withReadConcern(readConcern))

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#withReadPreference(com.mongodb.ReadPreference)]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#withReadPreference(com.mongodb.ReadPreference)]]
*/
def withReadPreference(readPreference: ReadPreference): MollySyncDatabase[F] =
MollySyncDatabase(delegate.withReadPreference(readPreference))

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#withWriteConcern(com.mongodb.WriteConcern)]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#withWriteConcern(com.mongodb.WriteConcern)]]
*/
def withWriteConcern(writeConcern: WriteConcern): MollySyncDatabase[F] =
MollySyncDatabase(delegate.withWriteConcern(writeConcern))
6 changes: 3 additions & 3 deletions molly-core/src/main/scala/molly/core/query/FindQuery.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ final case class FindQuery[F[_], A] private[core] (private[core] val publisher:
codec: MollyCodec[F, A]
):

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/FindPublisher.html#filter(org.bson.conversions.Bson)]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/FindPublisher.html#filter(org.bson.conversions.Bson)]]
*/
def filter(filter: Bson): FindQuery[F, A] = FindQuery(publisher.filter(filter))

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/FindPublisher.html#limit(int)]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/FindPublisher.html#limit(int)]]
*/
def limit(limit: Int): FindQuery[F, A] = FindQuery(publisher.limit(limit))

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/FindPublisher.html#sort(org.bson.conversions.Bson)]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/FindPublisher.html#sort(org.bson.conversions.Bson)]]
*/
def sort(sort: Bson): FindQuery[F, A] = FindQuery(publisher.sort(sort))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ final case class SyncWatchQuery[F[_], A] private[core] (private[core] val iterab
codec: MollyCodec[F, A]
):

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/ChangeStreamPublisher.html#resumeAfter(org.bson.BsonDocument)]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/ChangeStreamPublisher.html#resumeAfter(org.bson.BsonDocument)]]
*/
def resumeAfter(resumeToken: BsonDocument): SyncWatchQuery[F, A] = SyncWatchQuery(iterable.resumeAfter(resumeToken))

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/ChangeStreamPublisher.html#fullDocument(com.mongodb.client.model.changestream.FullDocument)]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/ChangeStreamPublisher.html#fullDocument(com.mongodb.client.model.changestream.FullDocument)]]
*/
def fullDocument(fullDocument: FullDocument): SyncWatchQuery[F, A] =
SyncWatchQuery(iterable.fullDocument(fullDocument))
Expand Down
4 changes: 2 additions & 2 deletions molly-core/src/main/scala/molly/core/query/WatchQuery.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ final case class WatchQuery[F[_], A] private[core] (private[core] val publisher:
MollyCodec[F, A]
):

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/ChangeStreamPublisher.html#resumeAfter(org.bson.BsonDocument)]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/ChangeStreamPublisher.html#resumeAfter(org.bson.BsonDocument)]]
*/
def resumeAfter(resumeToken: BsonDocument): WatchQuery[F, A] = WatchQuery(publisher.resumeAfter(resumeToken))

/** [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/ChangeStreamPublisher.html#fullDocument(com.mongodb.client.model.changestream.FullDocument)]]
/** [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/ChangeStreamPublisher.html#fullDocument(com.mongodb.client.model.changestream.FullDocument)]]
*/
def fullDocument(fullDocument: FullDocument): WatchQuery[F, A] = WatchQuery(publisher.fullDocument(fullDocument))

Expand Down
2 changes: 1 addition & 1 deletion molly-core/src/main/scala/molly/core/syntax/bson.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package molly.core.syntax
import scala.jdk.CollectionConverters.*

/** Syntactic sugar for
* [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/bson/org/bson/package-summary.html the Java driver's bson classes]].
* [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/bson/org/bson/package-summary.html the Java driver's bson classes]].
*/
trait bson:
type BsonArray = org.bson.BsonArray
Expand Down
2 changes: 1 addition & 1 deletion molly-core/src/main/scala/molly/core/syntax/model.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import org.bson.BsonDocument
import org.bson.conversions.Bson

/** Syntactic sugar for
* [[https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-core/com/mongodb/client/model/package-summary.html the Java driver's model classes]].
* [[https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-core/com/mongodb/client/model/package-summary.html the Java driver's model classes]].
*/
trait model:

Expand Down