-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
Hi, I'd like to be able to natively execute Javascript code on MongoDB via Mongoid / Moped
Here's a simplified example of what I'd like to do:
var cursor = #{ criteria.query.xxx ? } if (cursor.count < 100) { cursor } else { [] }
- criteria.query.xxx represents the serialized Javascript string for my Mongoid query criteria which I've passed-in via string interpolation, i.e {{db.customers.find(
{"name": "bob"}
)}}.
- The result should be serialized into Customer objects in Ruby.
Is this possible to do? (I'm using Mongoid 3 at the moment)