Results 70 comments of Mike Mintz

For your first query, you're right that its not working because the `arr` is still in ReQL AST instead of a vanilla JS array. A workaround for now would be:...

I don't think there's an easy way to do validate variable number of arguments like `getAll`. I'll need to think more about that one.

Great idea using `r.args`, that should work for `getAll`, and then yes you can use the same `RP.checkArr` workaround above. You can do: ``` javascript r.table('test').getAll( r.args(checkArr(arr => arr.every(e =>...

I think you want something like this: ```javascript // whitelisted query r.table("trades").orderBy({index: allowSpecificFieldOrderBy(RP, "datetime")}) .filter(r.row("currency").eq(allowAnyString(RP))) .filter(r.row("isExecuted").eq(true)) .filter(r.row('userId').eq(RP.ref('userId')) .pluck("datetime", "rate", "id") .changes({"includeInitial": true}).opt("db", r.db("cxihub")) .validate(function (refs, session) { return refs.userId ===...

This is not currently possible without modifying the library, but it is one of the goals of https://github.com/mikemintz/rethinkdb-websocket-server/issues/2. One approach would be to refactor `validateQueryCmd`, so that instead of returning...

Rather than doing string manipulations like `rawQuery.indexOf` and `rawQuery.replace`, I would recommend manipulating the query as JSON using `JSON.parse` and `JSON.stringify`. I would also run `validateQueryCmd` before doing the query...

You may also want to read through https://www.rethinkdb.com/docs/writing-drivers/ to get an idea of how the JSON is formatted, so it's more clear what part of the query you should manipulate.

We can do that, but we should make sure it doesn't break anything. Do you know what changed from 0.8.0 to 1.1.1? I'm looking at the [github releases](https://github.com/websockets/ws/releases) page and...

That sounds promising. Can you go ahead and make a PR? Then I'll merge and tag a new version of rethinkdb-websocket-server at 0.7.0. At least if there are any issues...

@mividtim that would be really cool to have. Although I have a hard time picturing how to implement it in a way that generalizes to different schemas. For example, I...