Skip to content

Instantly share code, notes, and snippets.

@detorto
Created June 1, 2017 20:41
Show Gist options
  • Save detorto/64746c9fbe8deb3c18c7a24dbd7f4d65 to your computer and use it in GitHub Desktop.
Save detorto/64746c9fbe8deb3c18c7a24dbd7f4d65 to your computer and use it in GitHub Desktop.
c := db.DB("db").C("queries")
result := Query{}
iter:=c.Find(nil).Sort("-SumbitTime").Iter()
for iter.Next(&result) {
if result.gparsed && result.yparsed {
fmt.Println("hellp")
} else {
fmt.Printf("Processed:", result)
change := bson.M{"$set": bson.M{"gparsed": true, "yparsed": true}}
err := c.UpdateId(result.ID, change)
if err != nil {
panic(err)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment