Himanshu Singh
05/30/2021, 10:02 AMHimanshu Singh
05/30/2021, 10:02 AMid:"60b2b269c0aa5f469eacce35"
username:"himanshuSingh-123"
passwordHash:"e8702cffbd643bfc389cbe8554027b9a716aec85df06bafeb86ca863dd067595:c7c66
Himanshu Singh
05/30/2021, 10:02 AMHimanshu Singh
05/30/2021, 10:02 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?GUIGAL Allan
01/05/2022, 11:15 PMfilter = and(
AvailabilitiesHolder::staffId eq staffId,
AvailabilitiesHolder::dayId eq slotDate.getId()
)
However, when using the pull of KMongo I struggle to make it typed with a variable :
update = pullByFilter(
property = AvailabilitiesHolder::serviceAvailabilities / serviceId,
filter = AvailableSlot::prebookingTag / PrebookingTag::owner eq owner
)
serviceId here is a function parameter and as it’s not a property I can’t use the typed query for this one and instead have to do this :
Updates.pull(
"${AvailabilitiesHolder::serviceAvailabilities.path()}.$serviceId",
AvailableSlot::prebookingTag / PrebookingTag::owner eq owner
)
I wonder if there was a cleaner way, maybe an operator to add variables alongside the typed queries with KProperty for nesting on the left side instead of right side values (like with eq or in...) thanks in advanceacoconut
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 PMtim
04/07/2022, 10:28 AMdata class Foo(val name: String, val other: String? = null)
val thing = Foo("bar")
...
insert(thing)
The document in mongo is {"name": "bar", "other": null}
when I want it to be {"name":"bar"}
. Alternatively, can I provide my own Json instance to kmongo?
Thanks!Qverkk
04/17/2022, 3:29 PMQverkk
04/17/2022, 3:31 PMjava.lang.ClassCastException: class kotlinx.serialization.json.internal.StreamingJsonEncoder cannot be cast to class com.github.jershell.kbson.BsonEncoder (kotlinx.serialization.json.internal.StreamingJsonEncoder and com.github.jershell.kbson.BsonEncoder are in unnamed module of loader 'app')
André 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()
)
André Martins
04/22/2022, 12:17 PMCoroutineFindPublisher<T>
? Some TestCoroutineFindPublisher<T>
like it exists for the reactive publisherTomas Kormanak
04/29/2022, 11:33 AMIsaacMart
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! 🙂Jorge Bo
07/21/2023, 5:36 PMCLOVIS
07/31/2023, 7:59 AMTomas Kormanak
10/05/2023, 1:50 PMClass 'StringId' is not registered for polymorphic serialization in the scope of 'Id'
Any idea?Ashni Mehta
11/05/2023, 6:05 PM