Archive for the ‘MongoDB’ Category

mongodb_consistent_backup: A quick example

Just a quick post here to share some notes I made when using the mongodb_consistent_backup tool. This was performed on a installed of Red Hat Enterprise Linux Server release 7.2 (Maipo) running python 2.7.5. Install required packages and clone the tools repo; yum install python python-devel python-virtualenv gcc yum install mongodb-org-tools yum install git git clone cd […]

A quick mongofile demo

Here’s a few simple examples of using the mongofiles utility to use MongoDB GridFS to store, search and retrieve files. Upload a file into MongoDB into a database called gridfs mongofiles -u admin -padmin –authenticationDatabase admin –db gridfs put xfiles.504-amc.avi 2016-11-15T21:44:30.728+0100 connected to: localhost added file: xfiles.504-amc.avi Two collections will be created in the gridfs database; fs.files […]

Remove an _id field from a mongoexport json document

Although the mongoexport tool has a –fields option it will always include the _id field by default. You can remove this with a simple line of sed. This was slightly modified from this sed expression. Given the following data… {“_id”:{“$oid”:”57dd2809beed91a333ebe7d1″},”a”:”Rhys”} {“_id”:{“$oid”:”57dd2810beed91a333ebe7d2″},”a”:”James”} {“_id”:{“$oid”:”57dd2815beed91a333ebe7d3″},”a”:”Campbell”} This command-line expression will export and munge the data… mongoexport –authenticationDatabase admin –db test […]

Update on pymmo and demo app

Just a quick update on my pymmo project I started over on github. As I stated earlier this year I want to get deeper into Python and would be writing tools for MongoDB (and potentially other databases). It doesn’t do a whole lot yet but I hope to make regular small improvements. Using the MongoDB […]

mmo: bash script to launch a MongoDB cluster

As I announced in my Technical Goals for 2016 I’m building tools for MongoDB with Python. My first published item is a bash script to create a MongoDB cluster. This cluster will be used to develop, and test, the tools against. It is not intended for any use other than this. The script lives over on […]