3 ms·
It does run on the database server-- see the documentation for more information: http://rethinkdb.com/api/javascript/filter/ http://rethinkdb.com/api/javascript
by andrewmunsell 12y ago
It does run on the database server-- see the documentation for more information: http://rethinkdb.com/api/javascript/filter/ http://rethinkdb.com/api/javascript/filter/
They key line(s) is/are:
Predicates to filter are evaluated on the server, and must use ReQL expressions. You cannot use standard JavaScript comparison operators such as ==, </> and ||/&&.
It's essentially equivalent to:
r.table('users').filter(r.row("signup_date").gt(signupFilter)).run(conn, callback);
- netcraft 12y agoah, that makes a bit more sense. Still impressive though. Thanks for the information.
- korijn 12y agoAm I correct in assuming that the implementation is similar to that of LINQ and ORMs like NHibernate or Entity Framework? Example: https://msdn.microsoft.com/en-us/data/jj573936.aspx https://msdn.microsoft.com/en-us/data/jj573936.aspx
- coffeemug 12y agoYes, that's right. If you want to know how it's implemented, check out this post -- http://rethinkdb.com/blog/lambda-functions/ http://rethinkdb.com/blog/lambda-functions/, it goes into quite a bit of depth into how the drivers work.
- coffeemug 12y agoA small note -- you can use arbitrary javascript expressions with the `r.js` command (rethinkdb.com/api/javascript/js/).