Skip to content

generation for id property type not supported #428

Description

@zmkn

@Serializable data class User( @Contextual @SerialName("_id") @JsonProperty("_id") val id: Id<User> = newId(), val nickName: String, val createdAt: Instant = System.now(), val updatedAt: Instant = createdAt, )

print user object:

User(id=6773740aed6dbd47aeb9718a, nickName=testBulkWrite, createdAt=2024-12-31T04:33:14.224893Z, updatedAt=2024-12-31T04:33:14.224893Z)

print user json string:

{"_id":"6773740aed6dbd47aeb9718a","nickName":"testBulkWrite","createdAt":"2024-12-31T04:33:14.224893Z","updatedAt":"2024-12-31T04:33:14.224893Z"}

When using the bulkWrite<User>("""[{ insertOne : { "document" : $userJson } }]""") method, the program executes to line 147 of "KMongoUtil.kt" where the value of if (!document.containsKey("_id")) is false. Should it be using document.getDocument("document").containsKey("_id") instead?

After testing, it should use """[{ insertOne : $userJson }]""".

1735622709266

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions