Have you ever looked at your build? I mean, really looked at your build?

Bazel has a feature that lets you see a graph of your build dependencies. It could help you debug things, but honestly it’s just really cool to see what your build is doing. To try it out, you’ll need a project that uses Bazel to build. If you don’t have one handy, here’s a tinyContinue reading “Have you ever looked at your build? I mean, really looked at your build?”

MongoDB Puzzlers #1

Suppose that the collection test.foo contained the following documents: {“x”: -5} {“x”: 0} {“x”: 5} {“x”: 10} {“x”: [0, 5]} {“x”: [-5, 10]} {“x”: [-5, 5, 10]} x is some combination of -5, 0, 5, and 10 in each document. Which documents would db.foo.find({“x” : {“$gt” : -1, “$lt” : 6}}) return? Click here toContinue reading “MongoDB Puzzlers #1”

Popping Timestamps into ObjectIds

ObjectIds contain a timestamp, which tells you when the document was created. Because the _id field is always indexed, that means you have a “free” index on your “created at” time (unless you have persnickety requirements for creation times, like resolutions of less than a second, synchronization across app servers, etc.). Actually using this indexContinue reading “Popping Timestamps into ObjectIds”