Exporting geojson mapbox shapes to mango db?

Viewed 44

I am working on a project where a user can outline an area in a map provided by mapbox. I would like to make it so that once the person saves their progress they can log out and log back in to find the area they outlined still there.

I would like to know how I can export a geojson file to my server. If it matters, I am using mango db.

Also, I am using React JS.

1 Answers

You can serialize the geojson feature to string and then store it in a string type column of your DB

JSON.stringify(feature, null, 2);
Related