Skip to content

Instantly share code, notes, and snippets.

@kvigen
kvigen / gist:c5aa7e2d17e13769d929
Last active September 24, 2015 23:54
oplog-converter
type ChangeEntry struct {
Namespace string
Type string // insert, update, or delete
ID string // the unique identifier of the object
Object map[string]interface{} // There are limitations on this object...
}
func convertOp(op map[string]interface{}) (*ChangeEntry, error) {
// Note that this has only been tested for the Mongo 2.4 format
@kvigen
kvigen / gist:5c782a2141ca7e071b34
Created September 26, 2014 03:12
Mongo Container in Prod
FROM ubuntu:precise
RUN apt-get -qq update && apt-get -y install wget && \
wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.4.0.tgz && \
tar xzf mongodb-linux-x86_64-2.4.0.tgz && \
install -t /usr/bin mongodb-linux-x86_64-2.4.0/bin/* && \
mkdir -p /data/db /var/lib/mongodb/ && \
rm mongodb-linux-x86_64-2.4.0.tgz && \
rm -rf mongodb-linux-x86_64-2.4.0
EXPOSE 27017
ENTRYPOINT ["usr/bin/mongod"]