Hey everybody! I'm using <meltano-map-transformer>...
# plugins-general
c
Hey everybody! I'm using meltano-map-transformer, it's working. But, I'd like to know how using de conditionals to define null values. I tried this way:
document__categoryId: "int(_['categoryId']) if 'categoryId' record else '__NULL__'"
I'm using mongodb to postgres. Thanks for support!
e
Would this work?
document__categoryId: "int(_['categoryId']) if 'categoryId' in record else None"
c
I tried. So all records were NULL
e
So
document__categoryId
was null in all records? Did
categoryId
have a value for those?
c
In my case, my database has 3 registers, 2 with categoryId of type number and 1 of type null. I did this way:
str(_['document__categoryId'] if 'document__categoryId' in record else 0)
Then, has saved the categoryId and None in document that no there value
In case, saved the value "None" like an string in database. I thinked that were there one way to let this automatic or something like this.
e
Try not wrapping the whole expression in
str(...)
, like
str(_['document__categoryId']) if 'document__categoryId' in record else 0
c
Tks! I'll try it now
👍 1