I’m fetching some data from a mongodb database and I will use it to prepare a json body to send another HTTP request with HTTPoison so I’m using Poison as always to encode the body into JSON STRING, but there is a BSON ObjectId “_id” field in my body and I have this error :
This is only a guess, but the BSON.ObjectId can’t be encoded as is, and needs special treatment; you have to tell Poison to encode BSON.ObjectId’s, I think.
Have you tried making a module under the lib directory as mentioned in that post? Try putting that code in a module named something like BSONObjectId in a file named something like lib/bson_object_id.ex. Are you stuck at the consolidated protocol error also mentioned in that post?
It sounds like you found this GitHub issue, but I cannot guess how much you’ve read, or what you’ve tried, or what new errors you’ve seen.