app/volt/tasks/live_query/data_store.rb in volt-0.8.15 vs app/volt/tasks/live_query/data_store.rb in volt-0.8.16
- old
+ new
@@ -7,15 +7,15 @@
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
+ # Extract query parts
+ query, skip, limit = query
- db[collection].find(query).to_a
+ cursor = db[collection].find(query)
+ cursor = cursor.skip(skip) if skip
+ cursor = cursor.limit(limit) if limit
+
+ return cursor.to_a
end
end