Agg document search

I add a document each time my clients login.
Customer : {id: 1, loginDate: '08/08/2016T10:12:23' }
I want to search all customers that logged between 24 to 36 hours ago and did not logged in in the last 24 hours.
Any idea how do i do it.
10x in advanced :+1:

You might be able to do it using a parent/child structure:

You would have to create a "parent" document for each user, and insert the login events as "child" documents. You might then be able to use appropriate has_child queries under the "filter" and "must_not" sections of a "bool" query.

Anyway, that's what I would try first. You will want to performance test it pretty early on, as the parent/child stuff has a reputation for being slow.