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

DBZ-7182: MongoDB : allow array with documents with optional fields #5035

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

olivierboudet
Copy link
Contributor

Which use case/requirement will be addressed by the proposed feature?

I would like to use Debezium with MongoDB. But in our use case, some documents have arrays of documents of same types BUT with optional fields.

In current implementation, it is not allowed, and this is documented :

array encoding

If array.encoding is set to array (the default), the SMT encodes uses the array datatype to encode arrays in the original message. To ensure correct processing, all elements in an array instance must be of the same type. This option is a restricting one, but it enables downstream clients to easily process arrays.

I was wondering if at least the schema could be generated based on the document with the maximum number of fields. The restriction is always true, but a little less strict... and might allow us to use debezium. Otherwise Debezium is not usable for us

@jpechane
Copy link
Contributor

@olivierboudet Hi, thanks for the PR. We'd definitely like that functionality. But I think we should intorduce a separate array handling mode that will do the array union schema.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants