How can I serialize an Origin::Selector object into something that I can feed directly into native Mongo?
Currently, to_json gets me nearly there, but I have to wrap certain types such as Date and ObjectId.
As an example, this is what to_json yields:
{
"$and": [
"archived":false,
"group_id":{
"$in":[
"52289c3cb777888350000002"
]
}
]
}
but I then have to convert to this before querying mongo:
{
"$and": [
"archived":false,
"group_id":{
"$in":[
ObjectId("52289c3cb777888350000002")
]
}
]
}
Is there an undocumented way to get the actual protocol query string from a Mongoid::Criteria or Origin::Selector object?