" Any "

How to use MongoDB date aggregation operators in Node.js with Mongoose ($dayOfMonth, $dayOfYear, $dayOfWeek, etc)

While I was working on creating a tutorial for MongoDB aggregation I came across a few issues while trying to use the built in date aggregation operators.  I was storing the date in the db as the unix epoch timestamp.  I tried multiple variations such as “new Date()”, “new Date().getTime()”, “Date.now()”, etc, but none of those would work.  I kept getting this error “can’t convert from BSON type NumberDouble to Date”.  Turns out, the solution was very simple, and something I completely overlooked (more…)

How to count the number of values found for a field in MongoDB using Node.js and Mongoose (using aggregation)

This post is part 1 of a series of posts I will make regarding Node.js and MongoDB.  I will be using the Mongoose module for Node.js, but for the most part the MongoDB syntax is about the same.  The ultimate goal with this series is to take data from a MongoDB database, and use that data to create a dynamic graph/chart with Morris.js.

The first step to this process is learning about MongoDB aggregation. The data we will be using in this example is a collection of products, that has a field product_manufacturer.  We will use MongoDB to return to us, the total number of products that each manufacturer has in our database.  So let’s get started .. (more…)

iGitLab – Configurable GitLab multi-version bash/shell installer script for Debian (Ubuntu, Linux Mint, etc)

So I finally decided to upgrade my git/svn server and to install a web gui to make things a little bit easier to view and track, which was when I stumbled upon GitLab.  If you don’t already know, GitLab is an open source, self-hosted, GitHub style, git server with a web based interface, using Ruby/Ruby on Rails.  After trying out a few of the scripts I found on GitHub to automate the install process, I found most were outdated, and lacked the ability to configure for future installations and/or versions.  That’s when I decided to write my own installer script, which I decided to call iGitLab, for Install GitLab. (more…)