MongoDB\BSON\toPHP to MongoDB\BSON\toGO ??? is there any function like this??
What do you mean by toPHP
and toGO
? What do you want do achieve?
Can you please properly describe what you are searching for?
Currently it reads just as if you were searching for a BSON (de)-serializer in Go, quickly googling brought up gobson as the most prominent one on the first page. If it doesnât suite you, you need to concretize your requirements or google for yourself.
i want to serialised that type of mongo data â
âabID.ID:2,ab:ggâ
Google brought up this:
http://php.net/manual/en/function.mongodb.bson-tophp.php
This reads as if it were a deserializer from BSON to PHP, thats why I also googled for BSON to Go (de)serializer and suggested. I hope it helps him.
In this case, your data is âserializedâ, if you want âdeserializedâ, you try this: https://github.com/bigdrum/phpserialize
But isnât that serialising and deserialising from some PHP-Marshalling format to a go struct?
I do read the OPs question that he wants to deserialise BSON objects he gets from a MongoDB into a Go struct. So until he clarifies I still think gobson is the right tool for the jobâŚ
So, try using library https://labix.org/mgo
Thanks to everyone for your help
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.