Hassan Ahamed Hassan Ahamed - 1 month ago 23
Node.js Question

How to convert SELECT * FROM users WHERE name IN ('Peter', 'John') and age=30 in rethinkDB?

SELECT * FROM users
WHERE name IN ('Peter', 'John') and age=30;


I am new in RethinkDB. I want to convert this query in RethinkDB using Node.js.

Can someone please help me?

Answer
r.db("mydb").table("users").filter(doc => doc("name").eq('Peter')
    .or(doc("name").eq('John')).and(doc('age').eq(30)));