Skip to content

Instantly share code, notes, and snippets.

View tfogo's full-sized avatar

Tim Fogarty tfogo

View GitHub Profile
@tfogo
tfogo / readme.md
Last active September 7, 2021 13:40
Editing mongodumps

Editing collection options and indexes in dumps

Dump directories

Dump directories have sub-directories for each database. Inside each database directory there is a metadata.json file for each collection. This file contains an extJSON representation of the collection options and index definitions. You can edit this file in a text editor to change the options and indexes.

If the dump was created with the --gzip option, the metadata.json file will be compressed. It will be a metadata.json.gz file. You can uncompress the file, edit it, then recompress it.

Dump archives

package main
import (
"context"
"log"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
)
@tfogo
tfogo / main.go
Created September 30, 2019 13:32
package main
import (
"context"
"fmt"
"log"
"strings"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"

Use Coupon Code GOPHERCON25 for $75 Atlas Credit

cloud.mongodb.com

Getting started with MongoDB and Go

Import the new official MongoDB Go Driver

import (
@tfogo
tfogo / main.go
Created March 26, 2019 11:24
Example use of Change Streams in Go
package main
import (
"context"
"fmt"
"log"
"os"
"time"
fuzz "github.com/google/gofuzz" // Used for creating random todo items
apiVersion: v1
kind: Deployment
metadata:
name: devops
labels:
env: prod
spec:
replicas: 10
# Update strategy used by this deployment
strategy:

Smooth DevOps Code of Conduct

All attendees, speakers, sponsors and volunteers at our meetup are required to agree with the following code of conduct. Organisers will enforce this code throughout the event. We expect cooperation from all participants to help ensure a safe environment for everybody.

Need Help?

Please contact the organizers:

@tfogo
tfogo / keybase.md
Created June 24, 2018 22:43
keybase.md

Keybase proof

I hereby claim:

  • I am tfogo on github.
  • I am tfogo (https://keybase.io/tfogo) on keybase.
  • I have a public key whose fingerprint is 1288 21E6 ADA9 3467 41F6 CE14 95E1 B63C BA74 349F

To claim this, I am signing this object:

@tfogo
tfogo / deploy-mlab.py
Last active August 26, 2019 14:14
Automate deploying with the mLab Management API
###################################################
# Automate deploying with the mLab Management API #
# Link Here: #
###################################################
#################
# STEP 0: Setup #
#################
@tfogo
tfogo / build-class-refs.sh
Created November 20, 2017 18:26
Little script I made to test class refs in carbon.io
#!/bin/sh
#set -xv
rootdir=`pwd`
bold=`tput bold`
normal=`tput sgr0`
red=`tput setaf 1`
green=`tput setaf 2`
white=`tput setaf 7`