mongodb on davidchua https://dchua.com/tags/mongodb/ Recent content in mongodb on davidchua Hugo -- gohugo.io en-us Mon, 08 Aug 2016 00:00:00 +0000 Building a Kubernetes PetSet Cluster for your MongoDB ReplicaSet https://dchua.com/posts/2016-08-08-building-a-kubernetes-petset-cluster-for-your-mongodb-replicaset/ Mon, 08 Aug 2016 00:00:00 +0000 https://dchua.com/posts/2016-08-08-building-a-kubernetes-petset-cluster-for-your-mongodb-replicaset/ Some observations when working with Kubernetes 1.3 introduced PetSets to build MongoDB. Here’s my PetSet YAML: # mypetset.yml apiVersion: v1 kind: Service metadata: annotations: service.alpha.kubernetes.io/tolerate-unready-endpoints: "true" name: a-mongo labels: name: a-mongo tier: database type: mongo spec: ports: - port: 27017 name: mongo type: NodePort selector: tier: database name: a-mongo --- apiVersion: apps/v1alpha1 kind: PetSet metadata: name: a-mongo spec: serviceName: "a-mongo" replicas: 3 template: metadata: labels: name: a-mongo tier: database annotations: pod. Converting KML into GeoJSON for Mongoimport & Querying https://dchua.com/posts/2016-03-31-converting-kml-into-geojson-for-mongoimport/ Thu, 31 Mar 2016 00:00:00 +0000 https://dchua.com/posts/2016-03-31-converting-kml-into-geojson-for-mongoimport/ First, you need to install kml2geojson. Luckily, there’s pip. $ pip install kml2geojson Once that’s done, you can take a .kml file and convert it into a GeoJSON format. Why GeoJSON? Because its gaining in support (MongoDB, RethinkDB) and has lots of smart people working on its specification. $ kml2geojson <.kml> <output_path> Now if you’re looking to import the geoJSON data into MongoDB so that you can do geospatial queries, you’ll need to prepare the GeoJSON file for import so that MongoDB will create multiple documents rather than a single document of your geo-objects.