title: How to save Geofence using Javascript?
body: <p>I am able to make a polygon on GoogleMap using following code:</p>
  
  <pre><code>//Function to create Polyline
  
  function connectPoints()
  {
   var point_add = []; // initialize an array
   var start = polyCoordinates[0]; // storing start point
   var end = polyCoordinates[(polyCoordinates.length-1)]; // storing end point
   // pushing start and end point to an array
   point_add.push(start);
   point_add.push(end);
   createPolyline(point_add); // function to join points
  
  }
  
  function createPolyline(polyC)
  {
      alert(polyC);
   Path = new google.maps.Polyline({
   path: polyC,
   strokeColor: boundaryColor,
   strokeOpacity: 1.0,
   strokeWeight: 2
   });
   Path.setMap(map);
  }
  </code></pre>
  
  <p>polyC is having the array of Lat and Longs. I need to save it in MongoDB with a fence name. Do I need to convert this array in JSON and save? </p>