Sha256: 561f7d7e80f5dc0daa0682097b73afcb0ac1ccaf75f218eeeab4cf857fbda386

Contents?: true

Size: 328 Bytes

Versions: 10

Compression:

Stored size: 328 Bytes

Contents

require 'mongo'

class DataStore
  def initialize
  end

  def db
    @@db ||= Volt::DataStore.fetch
  end

  def query(collection, query)
    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

10 entries across 10 versions & 1 rubygems

Version Path
volt-0.8.15 app/volt/tasks/live_query/data_store.rb
volt-0.8.14 app/volt/tasks/live_query/data_store.rb
volt-0.8.13 app/volt/tasks/live_query/data_store.rb
volt-0.8.11 app/volt/tasks/live_query/data_store.rb
volt-0.8.10 app/volt/tasks/live_query/data_store.rb
volt-0.8.9 app/volt/tasks/live_query/data_store.rb
volt-0.8.8 app/volt/tasks/live_query/data_store.rb
volt-0.8.7 app/volt/tasks/live_query/data_store.rb
volt-0.8.6 app/volt/tasks/live_query/data_store.rb
volt-0.8.5 app/volt/tasks/live_query/data_store.rb