Sha256: 1876432d9b0c9813996e9fdbcf41eeccd172c46687f86512ebc74917b5129955
Contents?: true
Size: 352 Bytes
Versions: 6
Compression:
Stored size: 352 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 return cursor.to_a end end
Version data entries
6 entries across 6 versions & 1 rubygems