mongodb
44 posts · All topics
- — Backing up DigitalOcean MongoDB to Dropbox
After migrating my apps to DigitalOcean apps I started looking for a MongoDB automated offsite backup solution. DO backs up all MongoDB daily automatically, but I am paranoid, a...
- — Migrating from Dokku to DigitalOcean Apps
In 2016 I moved half a dozen apps from Heroku to a DigitalOcean droplet to save money. I found dokku, a docker-powered PaaS. It was already quite mature, and worked flawlessly. ...
- — Restoring Data into a MongoDB Dokku Container
I’ve been running a pet project using Dokku on DigitalOcean for a number of years with MongoDB, backing up data into Dropbox. See Running Slack Bots on DigitalOcean with Dokku a...
- — Storing Timestamps in MongoDB with Mongoid
Coming from mongoid-locker#57, in which I, too, wasn’t sure whether calling .utc on a timestamp was necessary with Mongoid.
- — Grouping and Aggregating Weekly in MongoDB
Given a collection of events, aggregate their duration weekly. Fill gaps to contain every week since the earliest event.
- — Installing and Upgrading MongoDB in Dokku
This was expanded from Running Slack Bots on DigitalOcean with Dokku.
- — The Mongoid Community Organization
- — Very Slow MongoDB in Development and Test
MongoDB SERVER-24384 bit me.
- — Backing up MongoDB Databases in Dokku Containers to Dropbox
I’ve recently moved my Slack bots to Dokku running on DigitalOcean. The bots use local MongoDB database containers provided by the dokku-mongo plugin. Here’s the entire setup, f...
- — Getting Things Done with Mongoid 5
- — First Class Mongoid Queries with Collection Snapshots
Consider two domain models, a Widget and a Gadget.
- — 10 Largest Collections in a MongoDB Database w/ Mongoid
Mongoid.default_session.collections.map do |c| s = Mongoid.default_session.command(collstats: c.name) [c.name, s["size"] + s["totalIndexSize"] ] end.sort_by { |n, s| -s }.ta...
- — Data Corruption Is Most Likely Caused By Your Code And Not Your Database
- — Three DevOps Rake Tasks I Use Daily on Heroku with MongoDB
- — Migrating from a relational to a NoSQL cloud database?
- — Debugging 'object has no properties' in a MongoDB map/reduce
You got to love debugging JavaScript errors. Here’s one from a MongoDB map/reduce. The operation fails with this:
- — Returning a Sample Set from a Mongo Collection w/ Mongoid
module Mongoid class Criteria def sample(n = 1) indexes = (0..self.count-1).sort_by{ rand }.slice(0,n).collect! if n == 1 return self.skip(indexes.firs...
- — 5in5 NYC Episode 7
In good company with Bitfloor, NextBigSound and Crowdtap. What do we have in common? We use MongoDB.
- — MongoNYC 2012: Using MongoDB to Build Art.sy - Video
A recording of me speaking at MongoNYC 2012.
- — Paging and Iterating Over Large Mongo Collections
Sometimes you need to iterate over a large MongoDB collection. The biggest issue is that, by default, cursors timeout after 10 minutes of inactivity. For very large collections ...
- — Paginating w/ Mongoid 2.4.0, MongoMapper and Kaminari
I’ve upgraded our project from Mongoid 2.0.2 to 2.4.0. It took me a few days since our specs raised a couple of real issues. If you’re doing the same, take Mongoid from the tip ...
- — Blame it all on MongoDB
You may have read my previous post about the MongoDB 1.4.x Ruby driver hell.
- — Don't Use MongoDB?
“Little children, don’t go play in Africa … giant crocodiles are waiting to eat you!” – a popular Russian song.
- — Mongoid 2.0.2, Mongo + bson + bson_ext 1.4.0 and 1.4.1
In the past two days we’ve had hell with our production environment. It started with a general feel of slowness followed by all kinds of alarms going off in the monitoring syste...
- — Oracle Didn't Learn From the Redhat Experience, PRs a NoSQL Database
I just came back from Mongo Boston and I am really excited for 10gen. Once again I met actual human beings that were really happy about using a database and wanted to share that...
- — Mongo Boston 2011
En route to Boston, speaking at Mongo Boston tomorrow, Monday. I’m going to talk about our history with MongoDB at Art.sy, the challenges and, of course, about how much we like ...
- — Mongo Boston – October 3rd Cambridge, MA
I’m speaking at Mongo Boston on Monday about our experience using MongoDB for the Art Genome project.
- — Mongoid Collection Snapshot
Another fine open-source contribution from @aaw, mongoid_collection_snapshot: easy maintenance of collections of processed data in MongoDB with the Mongoid ODM.
- — Being Lazy: Using the Ruby driver to connect to MongoDB
One of my rake tasks failed with an interesting error this morning.
- — Happiness is MongoDB: Slides from MongoNYC Meetup
- — Storing Server-Side JavaScript Functions w/ Mongoid + Weekly Rollup
I was working on some map/reduce that rolled up daily, weekly and yearly statistics in MongoDB and discovered, to my surprise, that JavaScript Date doesn’t have a getWeek method...
- — Mongoid 2.0.2 Dropped Pagination => Kaminari
I was a bit surprised to see mongoid drop pagination support in 2.0.2 (here and here). It got some people confused (see mongoid#983). In a project that uses will_paginate, this ...
- — Delaying Image Processing on Heroku with delayed_job
There’s a Gem for That Too
- — RoR Win: 'Getting Things Done' with MongoDB Mongoid
- — Improving tags map/reduce with MongoDB 1.8.x
Today we’ll improve this map/reduce implementation that produces a collection of tags with their counts. We’ll add inline map/reduce for databases that support it, inline JavaSc...
- — Mongoid_fulltext: full-text n-gram search for your MongoDB models
- — Setting up Cron to run Rake Tasks
- — A Rake Task for Backing Up a MongoDB Database
It’s time to connect MongoDB with S3 and write a task that backs up a MongoDB database to Amazon S3. This follows a series of articles, so before you read this you might want to...
- — A Rake Task for Copying MongoDB Databases
Now that we have a staging and a production environment, we want to copy all production data to staging at the same time as we push new code to staging via continuous integratio...
- — Models look nice, but sometimes you just want to change they way they feel
Mongoid models provide an excellent level of abstraction. Consider a User model.
- — Seeding, exporting and importing MongoDB data with Rake
- — DataMapper: promoting columns into classes
I recently had to deal with reading a schema in a MySQL database in Ruby and migrating data to MongoDB. It has been made real easy with DataMapper (note: datamapper.org is no lo...
- — BSON::InvalidKeyName: key must not contain '.' or ‘$'
I ran into an error from Mongo, BSON::InvalidKeyName: key must not contain ‘.’ (or sometimes ‘$’ instead of ‘.’). It would happen randomly under RSpec (I do plan to check out Cu...
- — 2011 – The Year of NoSQL Data Breaches?
