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

Autogenerating of dynamic document source from a document #7

Open
anti-social opened this issue Sep 16, 2021 · 0 comments
Open

Autogenerating of dynamic document source from a document #7

anti-social opened this issue Sep 16, 2021 · 0 comments
Labels
hardcore A lot of work

Comments

@anti-social
Copy link
Owner

anti-social commented Sep 16, 2021

Linked to #1

val user = UserDoc.createDocSource {
    it[UserDoc.id] = 1
    it[UserDoc.name] = "grafana"
    it[UserDoc.group] = UserDoc.group.createDocSource {
        it[UserDoc.group.id] = 5
        it[UserDoc.group.name] = "metrics"
    }
}
val userId = user[UserDoc.id]
val userGroupName = user[UserDoc.group.name]

Which strategy should we use when accessing sub-document fields?

// Should we return `null` or throw an exception if `group` is an optional field and its value is missing?
user[UserDoc.group.name]
@anti-social anti-social added the hardcore A lot of work label Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hardcore A lot of work
Projects
None yet
Development

No branches or pull requests

1 participant