melatonina
02/14/2020, 10:12 PMmanlan
10/16/2020, 5:58 PMorg.litote.kmongo:kmongo-coroutine-serialization:4.1.3
in Ktor.
How would I serialize the ObjectId class to the String type in my class.Mattlangsenkamp
11/11/2020, 5:09 AMmanlan
01/02/2021, 11:17 AMHex Hex Hex
05/30/2021, 10:53 AMtim
11/23/2021, 4:18 PM@Contextual
to de(serialize) Instant as a Long for my ktor server and I want to de(serialize) it as a Mongo Date for db operations.
I am getting the expected behaviour when updating my document, but when I insertOne
the documents instant is being serialized as a Long not a date (L22). When I later run updateOne
the instant is being correctly serialised (L28). Any idea what I'm doing wrong here?acoconut
01/18/2022, 3:31 PM[ERROR] /Users/acoconut/.m2/repository/org/litote/kmongo/kmongo-core/4.4.0/kmongo-core-4.4.0.jar!/META-INF/kmongo-core.kotlin_module: (-1, -1) Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.2.
Does this mean that kmongo was compiled with 1.6.0 and that I’m using a lower version of kotlin (which I should be) that is not compatible OR does it mean that I have some other kind of version mess in my local?Tomas Kormanak
02/11/2022, 2:51 PMkotlinx.serialization
It is mentioned in docs, but I can't get it, Does someone have a code snippet with example?rocketraman
02/17/2022, 3:00 AMPoint
(GeoJSON) data using kotlinx-serialization... I see Mongo has a com.mongodb.client.model.geojson.Point
type, but kmongo doesn't recognize it.rocketraman
03/12/2022, 12:04 AMAndré Martins
03/25/2022, 2:41 PMQverkk
04/17/2022, 3:29 PMAndré Martins
04/19/2022, 10:14 AMinsertMany
query and trying to use an upsert although there is no InsertManyOption for upsert
I came up with the following but this is very inefficient, is there any other way to insert and ignore duplicates?
myCollection.bulkWrite(
*customers.map {
updateOne<Customer>(
Customer::id eq it.id,
KMongoUtil.toBsonModifier(it, UpdateConfiguration.updateOnlyNotNullProperties),
upsert()
)
}.toTypedArray()
)
IsaacMart
06/16/2022, 2:19 PMRyunos
10/12/2022, 2:18 PMfun <E : Any> SortProperty.toSortBson(kClass: KClass<E>): Bson {
val kProperty = kClass.memberProperties.find { it.name == this.property }
?: throw InvalidSortPropertyException(this.property, kClass.simpleName)
return if (this.direction == SortDirection.ASC) {
ascending(kProperty)
} else {
descending(kProperty)
}
}
jean
10/13/2022, 2:15 PMorg.litote.kmongo:kmongo-coroutine-serialization:4.7.1
as a dependency and I’m trying to count the documents in a collection with this
val collection = database.getCollection(collectionName, Document::class.java)
collection.countDocuments()
But this gives me a Publisher<T>
but I was expecting this to be a suspend
function. How am I supposed to use this?IsaacMart
11/03/2022, 9:48 AMStephen
02/09/2023, 2:10 PMStephen
02/10/2023, 7:35 AMribesg
02/15/2023, 2:06 PMThis version should be the last release in the KMongo repo (if no critical bug found).
A MR is planned to move the code into the MongoDB repository :champagne::clinking_glasses:
That's cool and all but where can we get an ETA? Is there an official MongoDB issue we can follow?
I'm stuck on KMongo 4.7.2 because the Java Mongo Driver has issue on version 4.8.0, which KMongo depends on. Now it has been fixed in subsequent 4.8.x patches, but KMongo was not updated. I could use some Gradle black magic to use KMongo 4.8.0 with Mongo 4.8.x but I'm kinda against that.
Now the Java Mongo Driver has been updated to 4.9.0 with a bunch of fixes and features. What do we do?Mark Vogel
02/17/2023, 12:46 AMJson
configuration, but I can't seem to find any mention of where to use that Json
configuration.
The closest I see is the reference to registerModule and registerSerializer, but I can't find those functions anywhere either.
I've included a screenshot of all the dependencies I have. Note these are all from:
implementation("org.litote.kmongo:kmongo-id-serialization:$kMongoVersion")
implementation("org.litote.kmongo:kmongo-coroutine-serialization:$kMongoVersion")
If someone could point me in the right direction I would appreciate it very much! 🙂