find (query, callback) {
		if (!callback) {
			return;
		}

		var todos = JSON.parse(localStorage[this._dbName]).todos;

		callback.call(this, todos.filter(function (todo) {
			for (var q in query) {
				if (query[q] !== todo[q]) {
					return false;
				}
			}
			return true;
		}));
	}
/**
	 * Finds items based on a query given as a JS object
	 * 
	 * This function gets the current todos from local storage and filters
	 * each of its element and iterates through their properties to check if they match
	 * the query
	 *
	 * @param {object} query The query to match against (i.e. {foo: 'bar'})
	 * @param {function} callback	 The callback to fire when the query has
	 * completed running
	 * @returns {boolean} Whether the object has been found or not
	 *
	 * @example
	 * db.find({foo: 'bar', hello: 'world'}, function (data) {
	 *	 // data will return any items that have foo: bar and
	 *	 // hello: world in their properties
	 * });
	 */
Finds items based on a query given as a JS object

This function gets the current todos from local storage and filters
each of its element and iterates through their properties to check if they match
the query

@param {object} query The query to match against
@param {function} callback    The callback to fire when the query has
completed running
@returns {boolean} Whether the object has been found or not

@example
db.find({foo: 'bar', hello: 'world'}, function (data) {
data will return any items that have foo: bar and
hello: world in their properties
}).
Finds items based on a query given as a JS object This function gets the current todos from local storage and filters each of its element and iterates through their properties to check if they match the query @param { object } query The query to match against @param { function } callback The callback to fire when the query has completed running @returns { boolean } Whether the object has been found or not @example db . find ( { foo : ' bar ' hello : ' world ' } function ( data ) { data will return any items that have foo : bar and hello : world in their properties } ) .
find (query, callback) {
		if (!callback) {
			return;
		}
		var todos = JSON.parse(localStorage[this._dbName]).todos;
		callback.call(this, todos.filter(function (todo) {
			for (var q in query) {
				if (query[q] !== todo[q]) {
					return false;
				}
			}
			return true;
		}));
	}
find ( query , callback ) { if ( ! callback ) { return ; } var todos = JSON . parse ( localStorage [ this . _dbName ] ) . todos ; callback . call ( this , todos . filter ( function ( todo ) { for ( var q in query ) { if ( query [ q ] !== todo [ q ] ) { return false ; } } return true ; } ) ) ; }
Finds items based on a query given as a JS object
Finds items based on a query given as a JS object