Sha256: a40547f2f39d9c53058ec2ad84d04b1545f1d7af89f28342a06675a4ce5cc1ae
Contents?: true
Size: 425 Bytes
Versions: 7
Compression:
Stored size: 425 Bytes
Contents
require 'mongo' class DataStore def initialize end def db @@db ||= Volt::DataStore.fetch end def query(collection, query) # Extract query parts query, skip, limit = query cursor = db[collection].find(query) cursor = cursor.skip(skip) if skip cursor = cursor.limit(limit) if limit cursor.to_a end def drop_database db.connection.drop_database(Volt.config.db_name) end end
Version data entries
7 entries across 7 versions & 1 rubygems