bbqchickenrobot
bbqchickenrobot

Reputation: 3709

RethinkDB Query to Find Duplicate Email Addresses (records)

I have the following ReQL Query which Identifies distinct addresses, but can't seem to add the not() method to get the opposite.

r.db('mydb').table('users').orderBy(r.desc('email')).without('id').distinct()

Upvotes: 2

Views: 653

Answers (1)

Etienne Laurin
Etienne Laurin

Reputation: 7184

not operates on booleans. .distinct().not() doesn't modify the distinct operation. It just gets applied applies to its result, which doesn't make much sense.

You could instead do something like this

r.db('mydb').table('users')
 .group('email').count().ungroup()
 .filter(row => row('reduction').gt(1))('group')

Upvotes: 4

Related Questions