3 ms·
so are we saying that r.table('users').filter(function(user){return user('signup_date').gt(signupFilter);}).run(... is running this filter in the database
by netcraft 12y ago
so are we saying that
r.table('users').filter(function(user){return user('signup_date').gt(signupFilter);}).run(...
is running this filter in the database, not in node?
- andrewmunsell 12y agoIt 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/).