https://kotlinlang.org logo
#kmongo
Title
# kmongo
i

IsaacMart

11/03/2022, 9:48 AM
I have a data class of Tasker which has an embedded list of skills from data class named Skill. I want to querry list of taskers based on category_skill which is found inside a skill that the tasker possess.i have tried couple of solution below but which work on the mongo playground but can't work in ktor. Bellow are the data classes.
r

rocketraman

11/03/2022, 6:12 PM
Should work:
Copy code
taskers.find(Tasker::skills / Skill::category_name eq …)
You can always see what json is being produced using the
.json
extension, to check if the kmongo query matches your playground query e.g.
Copy code
println((Tasker::skills / Skill::category_name eq …).json)
i

IsaacMart

11/04/2022, 7:06 AM
I do appreciate @rocketraman you saved the day. I have been finding solutions to do with mongo instead of kmongo.
26 Views