Hello! Would it be possible to create a query that goes through all access logs for all users and return an object with arrays with ips that has been used on multiple users?
If it could return an object/print somehow which users has had the same ip and group them together? We have some users creating a lot of accounts (which is not allowed) but does’t always change his ip.
Note that if you’re only using the ip and user fields, having an index on these (as shown above) should greatly improve the performance of this operation.
Hi @alexbevi the results are exactly what I was looking for. Thank you so much!
However, with our database it doesn’t really work, Maybe i wasn’t clear enough before but the collection has all logins so with your query it will just add the same user multiple times on all ips if the user have logged in more than once? (which most users have.
So it should just add the user if it’s not a duplicate of itself
The one with 123 that also gets returned is from the same user logging in 3 times so that’s nothing wrong while user 2 & 3 both login on on the ip “456” which should be returned as it does now
Thanks for clarifying. What you’re looking to do can be best accomplished by adding the user IDs to a set, then filtering the results by sets with more than 1 entry: