I'm pretty new to Mongo, I'm wondering if this is possible:
- I have a collection of over 1 million documents, with timestamps from 2014 to 2017.
- Each timestamp contains both date as well as the time
- I want to see the documents that are sharing some attributes (for example
brand: "Apple", cpu: "i5"
) and have timestamps within 10 minutes of each other, across my whole dataset - in groups
So I imagine it to work like:
- Take first document matching the
brand: "Apple", cpu: "i5"
- Look for documents with timestamp within 10 minute of that document's
- Return an array of those documents.
- Take next document that matches the query (but one that wasn't included in the previous group) - repeat
- Return a list of lists of documents grouped in this manner
Is this something that MongoDB has out of the box, or something I would need to code manually?