Sha256: 25a136a0ea55d801f7d8755a8a0c06b0acca29e30aed020136eff2c3d3dc7b73
Contents?: true
Size: 433 Bytes
Versions: 1
Compression:
Stored size: 433 Bytes
Contents
require 'mongo' class DataStore def initialize @@mongo_db ||= Mongo::MongoClient.new("localhost", 27017) @@db ||= @@mongo_db.db("development") end def query(collection, query) puts "QUERY: #{collection} - #{query.inspect}" query = query.dup query.keys.each do |key| if key =~ /_id$/ query[key] = BSON::ObjectId(query[key]) end end @@db[collection].find(query).to_a end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
volt-0.7.17 | app/volt/tasks/live_query/data_store.rb |