ozlerhakan / mongolastic

:traffic_light: A dataset migration tool from MongoDB to Elasticsearch and vice versa.
MIT License
136 stars 34 forks source link

$numberLong imported as object to ES 5 #24

Closed webfrank closed 6 years ago

webfrank commented 7 years ago

Hi, I have a mongo collection with several fields like {"$numberLong":"1502353998000"} and them are imported to ES the same and not as 1502353998000

winder commented 7 years ago

Try setting long to string to true in your yaml config

webfrank commented 7 years ago

Yes but I got it mapped to text instead of long and I cannot do operation on that field.

winder commented 7 years ago

Mongo has a "codec" plugin system, since there are already a couple being configured by mongolastic you could add another flag pretty easily (or modify CustomLongCodec in your local branch). Here is the relevant code https://github.com/ozlerhakan/mongolastic/search?utf8=%E2%9C%93&q=CustomLongCodec&type= .

You might also be able to define the schema in elasticsearch.

On Mon, Sep 11, 2017 at 5:08 AM, webfrank notifications@github.com wrote:

Yes but I got it mapped to text instead of long and I cannot do operation on that field.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ozlerhakan/mongolastic/issues/24#issuecomment-328468012, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHqRRSv3qgtUssuoZZM5nKjKAXlfZRZks5shPiQgaJpZM4PSXBT .