I am Hack Sparrow
Captain of the Internets.

Archive for Database

Mongoose Pagination Plugin – Mongoose Pages

I have been wanting to write a Mongoose pagination plugin for a long time. Not that there were no pagination plugins for Mongoose, it is just that the available plugins had a rather developer-unfriendly API. Officially presenting Mongoose Pages - the developer-friendly pagination plugin for Mongoose. Installing Mongoose Pages is simple. Just type the following command at the terminal. [code] $ npm install mongoose-pages [/code] If your ...

MySQL Pagination

The secret to paginating MySQL results lies in the LIMIT clause of its SELECT command. We'll learn how to paginate results using PHP and Node.js, in order to understand better we'll work with data from a sample table. Create a new database named learnmysql and run this query on it (we are creating a table named songs and populating it some sample data to work on): [code] CREATE TABLE `songs` ( ...

Install Redis on Ubuntu and Mac

Redis caught your interest and want to try it on your Mac or Ubuntu? Excellent! Installing Redis is almost similar in Mac and Ubuntu. wget does not come installed by default on Mac, so install wget first if you are on Mac. And here we go: [code] $ wget http://redis.googlecode.com/files/redis-2.4.8.tar.gz $ tar -zxvf redis-2.4.8.tar.gz $ cd re ...

MongoDB with Node.js

MongoDB and Node.js belong to the same league - new age Web technologies that are shaking up the world of Web development. Both of them are revolutionary alternatives to the traditional technologies like MySQL and PHP. Combining Node.js and MongoDB could be the very best option for your next website or app. Now the question is how do you use MongoDB with Node.js? Node.js has a huge collection of excellent module for many many purposes; naturally there ...

Mongoskin Tutorial with Examples

Mongoskin is probably the most developer-friendly MongoDB driver for Node.js at the moment - it is asynchronous and has a clean looking structure. But its docs are not that developer-friendly (the effort is much appreciated though) - no good examples or explanation; probably because English isn't the author's first language. After realizing that the Mongoskin docs may ...