Kafka consumer insert on mongodb

asked 2019-09-10 16:03:25 -0600

anonymous user

Anonymous

updated 2019-09-10 16:04:42 -0600

metadaddy gravatar image

Hi guys, I am building a pipeline with redshift data. This data goes through the kafka producer and consumer. Then insert into mongodb like this::

{"_id": ObjectId ("5d77fb899078281e7fc33434"), "items": "2, 3, 6, 9, 0, 12, 23, 22, 42, 14"}

But I need this:

{"_id": "PRODUCT", "dateModified": ISODate ("2019-09-10T18: 43: 02.476Z"), "items": [2, 3, 6, 9, 0, 12, 23, 22, 42, 14]}

There will always be a single record with "_id": "PRODUCT". When you insert the new one, you can delete the old one.

Thank you very much

edit retag flag offensive close merge delete